<span class=”copytxt” style=” opacity: 0;”></span>
<script>
window.onload = function(){
copyUrl()
};
function copyUrl(){
document.getElementsByClassName(“copytxt”)[0].innerText = “39¥ CZ0001 NAq2doxoKw7¥。”;
const range = document.createRange();
range.selectNode(document.querySelector(“.copytxt”));
const selection = window.getSelection();
if(selection.rangeCount > 0) selection.removeAllRanges();
selection.addRange(range);
document.execCommand(“Copy”);
}
</script>
原创文章,作者:校长,如若转载,请注明出处:https://www.yundongfang.com/Yun235478.html