First, the method
Party 1:
Window.clipboarddata unfortunately does not support chrome, Chrome will be prompted to find the Clipboarddata object
Party 2: Using the Zeroclipboar.js plugin written by foreign Daniel, the principle is to use Flash plug-ins to cover the response copied DOM objects
<!--here is the HTML code section -<textareaID= "Content"rows= "Ten"cols= "$">Here are the things to copy</textarea><inputID= "Copy"type= "button"value= "Copy"></Body><Scriptsrc= "<?php echo yii::app ()->baseurl;? >/resources/libs/js/zeroclipboard/zeroclipboard.js "></Script><Scriptlanguage= "JavaScript"> varClip= NewZeroclipboard (document.getElementById ('Copy')); Clip.on ({" Ready": function() {alert ("load Complete!"); }, "Copy" : function(e) {alert ('Copy'); E.clipboarddata.setdata ("Text/plain", "here is the plain text data for replication");}, "aftercopy": function(e) {alert ('Copy complete');} });</Script>
[JAVASCRIPT] Implementation page copied to computer clipboard