<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>

</head>

<body>
 <div > 2222</div>

</body>

</html>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
$(function(){

var update = function(original){
   var new_content = $('.testmr').html();
  
   var new_content = new_content.replace(/class="[^"]+"/ig, '');
  
   new_content = new_content.replace(/class\="[^"]+"/gi, '');
 
   new_content = new_content.replace(/<h1.*?>(.*?)<\/h1>/ig,"$1");
  
   new_content = new_content.replace(/<h2.*?>(.*?)<\/h2>/ig,"$1");
  
   new_content = new_content.replace(/<h3.*?>(.*?)<\/h3>/ig,"$1");
  
   new_content = new_content.replace(/<h4.*?>(.*?)<\/h4>/ig,"$1");
  
   new_content = new_content.replace(/<h5.*?>(.*?)<\/h5>/ig,"$1");
  
   new_content = new_content.replace(/<h6.*?>(.*?)<\/h6>/ig,"$1");
  
   new_content = new_content.replace(/style\="[^"]+"/gi, '');
  
   alert(new_content);
  $('.testmr').html(new_content);
  }
  
  $('.testmr').bind('paste',function(e){
   var $this = $(this); 
   var original = $this.html();
   setTimeout(function(){update();}, 10);
   
    })
  })

</script>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-28
  • 2021-07-25
  • 2021-11-10
  • 2021-10-14
相关资源
相似解决方案