function copyArticle(event) { const range = document.createRange(); range.selectNode(document.getElementById('copyBT')); const selection = window.getSelection(); if(selection.rangeCount > 0) selection.removeAllRanges(); selection.addRange(range); document.execCommand('copy'); alert("复制成功") } document.getElementById('contentas').addEventListener('click', copyArticle, false);

 

相关文章:

  • 2022-12-23
  • 2021-12-03
  • 2021-06-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
  • 2021-11-15
  • 2021-10-15
相关资源
相似解决方案