Live2D

jQuery复制文本

jQuery复制文本

//copyId 要复制的内容
function copy(copyId) {
    console.log(copyId)
    var oInput = document.createElement('input');
    oInput.value = copyId;
    document.body.appendChild(oInput);
    oInput.select(); // 选择对象
    document.execCommand("Copy"); // 执行浏览器复制命令
    oInput.className = 'oInput';
    oInput.style.display = 'none';
    layer.msg("复制成功", { time: 500 });
}

 

posted @ 2023-07-17 16:10  webmtjj  阅读(234)  评论(0)    收藏  举报