function handleCopy(){
const range = document.createRange();
range.selectNode(document.getElementById('echo_url'));
const selection = window.getSelection();
if (selection.rangeCount > 0) selection.removeAllRanges();
selection.addRange(range);
document.execCommand('copy');
selection.removeRange(range);
}
原生js 复制功能
最新推荐文章于 2024-04-17 08:47:34 发布