Thomas Fuchs
Hi, I'm Thomas Fuchs. I'm the author of the script.aculo.us user interface JavaScript library, a member of the Prototype core team and a Ruby on Rails core alumnus.
You're using my JavaScript work every day, even if you're not aware of it!
@thomasfuchs on Twitter    Need consulting, corporate training or want me to speak at your conference? Contact me!

Prototype gets selector magic

January 18th, 2006

Sam 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.