常見的復制粘貼功能其實可以很容易的實現:
...... <button onclick="copyNow()">復制</button> <textarea> 這是馬上被復制的文字 </textarea> ......
1 function copyNow(){ 2 var text = $('textarea'); 3 text.select(); 4 document.execCommand("Copy"); 5 }
這是實現復制功能,其他的功能也可以如法炮制。
常見的復制粘貼功能其實可以很容易的實現:
...... <button onclick="copyNow()">復制</button> <textarea> 這是馬上被復制的文字 </textarea> ......
1 function copyNow(){ 2 var text = $('textarea'); 3 text.select(); 4 document.execCommand("Copy"); 5 }
這是實現復制功能,其他的功能也可以如法炮制。
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。