📌  相关文章
📜  js 复制文本到剪贴板 - Javascript 代码示例

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

代码示例6
Also works on safari!
  
function copyToClipboard() {
    var copyText = document.getElementById("share-link");
    copyText.select();
    copyText.setSelectionRange(0, 99999);
    document.execCommand("copy");
}