js moving end to the clipboard

1  // copy to clipboard 
2          function Copy (STR) {
 . 3              var Save = function (E) {
 . 4                  e.clipboardData.setData ( 'text / Plain', STR); // the clipboardData objects 
. 5                  e.preventDefault () ; // prevent the default behavior 
6              };
 7              document.addEventListener ( 'Copy' , the Save);
 8              return document.execCommand ( "Copy"); // make the document editable, otherwise invalid 
9          }

Guess you like

Origin www.cnblogs.com/aui-js/p/12145093.html