js 复制到剪切板

  function copyTextToClipboard(text) {
                var copyFrom = $('<textarea/>');
                copyFrom.text(text);
                $('body').append(copyFrom);
                copyFrom.select();
                document.execCommand('copy');
                copyFrom.remove(); 
  }

 

posted @ 2016-09-26 14:02  N1900  阅读(154)  评论(0编辑  收藏  举报