正则表达式.
var content = prnhtml.replace(/修改/g, " ").replace(/删除/g, " ").replace(/操作/g, " ").replace(/权限/g, " ").replace(/选中/g, " ").replace(/\|/g, " ");
content里面还有一段
<input id= "DataList1_ctl02_CheckBox1 " type= "checkbox " name= "DataList1$ctl02$CheckBox1 " />
<input id= "DataList1_ctl03_CheckBox1 " type= "checkbox " name= "DataList1$ctl03$CheckBox1 " />
这些HTML代码.正则表达式是二桶水.不知道后面的该怎写了..帮帮忙.谢谢咯.
------解决方案--------------------你要把
<input id= "DataList1_ctl02_CheckBox1 " type= "checkbox " name= "DataList1$ctl02$CheckBox1 " />
替换后是什么
------解决方案--------------------除掉type是checkbox的标签?
try:
var content = content.replace(/\ <input[\s\S]*?type=\ "?checkbox\ "?[\s\S]*?\> /ig, " ");