📜  js 复制字符串到剪贴板 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:51.892000             🧑  作者: Mango

代码示例6
const el = document.createElement('textarea');
el.value = str;    //str is your string to copy
document.body.appendChild(el);
el.select();
document.execCommand('copy');    // Copy command
document.body.removeChild(el);