function copyTextToClipboard(text) { var copyFrom = $(‘<textarea/>‘); copyFrom.text(text); $(‘body‘).append(copyFrom); copyFrom.select(); document.execCommand(‘copy‘); copyFrom.remove(); }
时间: 2024-11-06 07:10:07
function copyTextToClipboard(text) { var copyFrom = $(‘<textarea/>‘); copyFrom.text(text); $(‘body‘).append(copyFrom); copyFrom.select(); document.execCommand(‘copy‘); copyFrom.remove(); }