复制代码 代码如下:
<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[\s\S]*?><span[\s\S]*?>(.*?)<\/span><\/p>/gi;
strout=str.replace(re,"<p>$1</p>");
returnstrout;
}
</script>
