首页 > Web开发 > 详细

原创]通过脚本清空标签p中的class名和style" target="_blank">[原创]通过脚本清空标签p中的class名和style

时间:2016-01-29 14:44:46      阅读:234      评论:0      收藏:0      [点我收藏+]

复制代码 代码如下:

<textarea name=jb51 cols=60 rows=6>  
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 0.05pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: ‘Times New Roman‘; mso-hansi-font-family: ‘Times New Roman‘">文本文本文本。</SPAN></p> 
</textarea><button onclick=alert(ubb(jb51.value))>alert</button>  
<script>  
function ubb(str)  
{  var strout;
    var re=/<p[\s\S]*?><span[\s\S]*?>(.*?)<\/span><\/p>/gi; 
    strout=str.replace(re,"<p>$1</p>");
return strout;
}  
</script>

[原创]通过脚本清空标签p中的class名和style,bubuko.com" style="color:#ffffff">原创]通过脚本清空标签p中的class名和style" target="_blank">[原创]通过脚本清空标签p中的class名和style

原文:http://www.jb51.net/article/3642.htm

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!