document.addEventListener("copy", copy);//监听复制事件
function copy(oEvent){
  var text = oEvent.srcElement.innerHTML;
 
  if (text) { 
    text = text + "\n-------本文来自“天天晒秘密”。 原文地址:"+location.href;
    oEvent.preventDefault();
    oEvent.clipboardData.setData("text", text);
  } 
}

 

相关文章:

  • 2022-12-23
  • 2021-12-10
  • 2021-12-23
  • 2021-08-04
  • 2022-12-23
  • 2021-05-27
  • 2022-12-23
  • 2021-09-12
猜你喜欢
  • 2021-12-10
  • 2021-07-25
  • 2021-04-27
  • 2021-10-29
  • 2021-04-27
  • 2021-11-27
  • 2021-12-03
相关资源
相似解决方案