开发者

Remove an element's class attribute with Hpricot

How do I do it开发者_如何学运维? E.g.,

<span class="selected" id="hi">HELLO</span>

should become

<span id="hi">HELLO</span>


span = Hpricot(some_html) % "span#hi"
span.remove_attribute("class")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜