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

复制代码 代码如下:

<textareaname=jb51cols=60rows=6>

<Pclass=MsoNormal><SPANTimesNewRoman';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>

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