<div id="content">文本xx<div>
function Copy(){
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');
}