Prototype gets selector magic
January 18th, 2006Sam Stephenson doesn’t stop to add new wonders to the Prototype JavaScript framework and the new $$ function that just got added to the Prototype SVN trunk is sure a fine example:
Example: Find all <img> elements inside <p> elements with class “summary”, all inside the <div> with id “page” and hide each matched <img> tag:
$$('div#page p.summary img').each(Element.hide);
Great stuff.
Tweet