正则表达式html:用正则表达式格式化html标签的代码来源: 发布时间:星期日, 2009年9月6日 浏览:5次 评论:0
复制代码 代码如下:
<html> <head> </head> <body> <style> #x_edit{ height:320px; width:540px; border:1px solid #666666; color:red; filter:chroma(color="#0f0f0f"); background-color:#f0f0f0; font-family:verdana; font-size:11px; line-height:13px; margin-left:16px; overflow:scroll; border-left:none; scrollbar-arrow-color:#666666; scrollbar-base-color:#666666; scrollbar-darkshadow-color:#f0f0f0; scrollbar-face-color:#f0f0f0; } </style> <span _disibledevent=><div contentEditable="true" id="x_edit" style='position:relative;line-height:13px;background-color:#f0f0f0;filter:Chroma(color=#FDFEFF);width:540px;height:320px;overflow:auto;white-space: nowrap; z-index: 2;border:0px'> <P><html><BR><head><BR></head><BR><body><BR><style><BR>#x_edit,#x_edit1{<BR> height:320px;<BR> width:540px;<BR> border:1px solid #666666;</P> <P> color:red;</P> <P> filter:chroma(color="#0f0f0f");<BR> background-color:#f0f0f0;<BR> font-family:verdana;<BR> font-size:11px;<BR> line-height:13px;<BR> margin-left:16px;<BR> overflow:scroll;<BR> border-left:none;<BR> scrollbar-arrow-color:#666666;<BR> scrollbar-base-color:#666666;<BR> scrollbar-darkshadow-color:#f0f0f0;<BR> scrollbar-face-color:#f0f0f0;<BR> }<BR></style><BR><span _disibledevent=></div> <script> function abc{ var s=x_edit.innerText; s=s.replace(/<\/?(\w+[\s\S]*?)>/gi,function(a){ a.replace(/[\r\n]/gi,"")}); x_edit.innerText=s; } </script> </body> </html> 0
相关文章读者评论发表评论 |