js 允许文本框内容 复制黏贴到粘贴板
<input type="text" name='textValue' onmousedown="rightclick(event)" /> function rightclick(event) { if (event.button == 2) { var textValue = $("input[name='textValue']"); Phone.select(); // 选择对象 document.execCommand("Copy"); // 执行浏览器复制命令 copyToClipboard(); //复制到粘贴板 现在可以复制黏贴了 } else { // $("input[name='textValue']").val(""); $("input[name='textValue']").focus(); } }
不要在自己迷茫的时候不学习