public Method

Elements.empty

Empty the elements in this list, by removing their insides.

doc = Hpricot("<p> We have <i>so much</i> to say.</p>")
doc.search("i").empty
doc.to_html
  => "<p> We have <i></i> to say.</p>"

Source Code

# File hpricot/elements.rb, line 126
def empty
  each { |x| x.inner_html = nil }
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.