首页 > 代码库 > js 复制到剪切板

js 复制到剪切板

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

 

js 复制到剪切板