This article mainly describes the compatibility of all browsers JS replication plug-in zero use, the need for friends can refer to the following
Three plugins are required here,: jquery.js zeroclipboard.js zeroclipboard.swf Good luck! Code as follows: <meta charset= "Utf-8"/> <button id= "D_clip_button" data-clipboard-target= "Fe_text" > Click Copy </button> <input id= "Fe_text" value= testing text. "/> <script type=" text/ JavaScript "src=" Http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js ></script> < Script type= "Text/javascript" src= "ZeroClipboard.min.js" ></script> <script type= "Text/javascript" "> $ (document). Ready (function () { zeroclipboard.setdefaults ({ moviepath:" zeroclipboard.swf " }"; var clip = new Zeroclipboard ($ ("#d_clip_button")); Clip.on ("Load ", function (client) { console.log (" Zeroclipboard. "); Client.on ("Complete", function (client, args) { console.log ("content copied: + args.text); }"; }) ; }); </script>