通过脚本清空标签p中的class名和style 原创
通过脚本清空标签p中的class名和style 原创
发布时间:2016-12-29 来源:查字典编辑
摘要:复制代码代码如下:文本文本文本。alertfunctionubb(str){varstrout;varre=/(.*?)/gi;strout...

复制代码 代码如下:

<textareaname=jb51cols=60rows=6>

<Pclass=MsoNormalstyle="MARGIN:0cm0cm0pt0.05pt;TEXT-INDENT:21pt;mso-char-indent-count:2.0;mso-char-indent-size:10.5pt"><SPANstyle="FONT-FAMILY:宋体;mso-ascii-font-family:'TimesNewRoman';mso-hansi-font-family:'TimesNewRoman'">文本文本文本。</SPAN></p>

</textarea><buttononclick=alert(ubb(jb51.value))>alert</button>

<script>

functionubb(str)

{varstrout;

varre=/<p[sS]*?><span[sS]*?>(.*?)</span></p>/gi;

strout=str.replace(re,"<p>$1</p>");

returnstrout;

}

</script>

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新正则表达式学习
热门正则表达式学习
编程开发子分类