var s = '<a href="xxx">xxxababa</a>fjaljoxox<img src="xxxx"/>fjaljfoxoxoaa<p>fjxxp</p><b>fjdlfjo</b>'
s = s.replace(/<\/?(img|a)[^>]*>/gi, '');
alert(s)
求富文本用js过滤部分标签但保留文本内容代码! var s = '<a href="xxx">xxxababa</a>fjaljoxox<img src="xxxx"/>fjaljfoxoxoaa<p>fjxxp</p><b>fjdlfjo</b>' s = s.replace(/<\/?(img|a)[^>]*>/gi, ''); alert(s)...