从html中删除具有属性的特定标记

时间:2013-06-04 07:51:29

标签: tags html

我想从html文件中删除标签....但只包含具有特定属性的标签。

例如,我可能有以下代码:

<span class = 'A'>This is the first sentence.</span><span id = 'B'>This is the second sentence</span>

我想删除所有出现的<span id = 'B'>,结果如下

<span class = 'A'>This is the first sentence.</span>This is the second sentence

有什么想法吗?

0 个答案:

没有答案
相关问题