标签:dev table and cli range func fun false command
function copyArticle() { | |
const range = document.createRange(); | |
range.selectNode(document.getElementById(‘content‘)); | |
const selection = window.getSelection(); | |
if(selection.rangeCount > 0) selection.removeAllRanges(); | |
selection.addRange(range); | |
document.execCommand(‘copy‘); | |
alert("复制成功!"); | |
} | |
document.getElementById(‘copyBT‘).addEventListener(‘click‘, copyArticle, false); |
标签:dev table and cli range func fun false command
原文地址:https://www.cnblogs.com/jyc226/p/11606874.html