现在的位置: 首页 > 综合 > 正文

复制文本到剪切板

2013年02月02日 ⁄ 综合 ⁄ 共 180字 ⁄ 字号 评论关闭
function copyText(obj) {
   var rng = document.body.createTextRange();
   rng.moveToElementText(obj);
   rng.scrollIntoView();
   rng.select();
   rng.execCommand("Copy");
   rng.collapse(false);
}

 

抱歉!评论已关闭.