js 复制表格

 

 

const selection = window.getSelection();
const range = document.createRange();
const target = document.querySelector('data-content');

selection.removeAllRanges();
range.selectNode(target);
selection.addRange(range);
document.execCommand('copy');
selection.removeAllRanges();

posted @ 2021-07-01 16:14  C丶c  阅读(331)  评论(0编辑  收藏  举报