开发者

Remove an element's class attribute with Hpricot

开发者 https://www.devze.com 2023-01-07 13:44 出处:网络
How do I do it开发者_如何学运维? E.g., <span class=\"selected\" id=\"hi\">HELLO</span>

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

精彩评论

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