1.这种方式只可以对显示的textbox和textarea使用,对于display:none和visibility hidden 以及其他标签无效

var message = document.getElementById("compcode240");
message.select(); // 选择对象
document.execCommand("Copy"); // 执行浏览器复制命令

如想用把文本框隐藏可用如下方式,设置绝对位置,top:-999999

<input class='k-textbox' id="hidspecial" name='hidspecial' style="position: absolute;top:-99999px"/>

 

2.想实现剪切板功能可使用第三方js(jquery.zclip.min.js

http://www.w3dev.cn/download/20130409/jquery.zclip.js.aspx#dl

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-10
  • 2022-12-23
  • 2022-03-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-03
  • 2021-12-17
  • 2021-12-02
  • 2022-12-23
  • 2021-06-16
  • 2022-02-01
相关资源
相似解决方案