gongwangwang

//复制页面文本去除复

        //复制页面文本去除复制内容含有的样式
      window.addEventListener(\'copy\', function(clipBoardEvent) {
        var text = window.getSelection().toString();

        console.log(clipBoardEvent);

        clipBoardEvent.clipboardData.setData(\'text/plain\', text); 
        
                // 写入文本
        clipBoardEvent.preventDefault();

       });        

 

分类:

技术点:

相关文章:

  • 2022-01-31
  • 2021-12-20
  • 2021-12-25
  • 2022-12-23
  • 2021-07-25
  • 2021-12-10
  • 2021-10-10
  • 2022-12-23
猜你喜欢
  • 2021-04-19
  • 2022-12-23
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2021-11-18
相关资源
相似解决方案