Prototype.js CSS selector function

Ajaxian reports on Prototype’s new CSS selector function. This is similar to Dean Edwards’ CSS Query.

With this new feature, you could do the following:

$$('div#page p.summary img').each(Element.hide);

This will find all DOM elements which matches the CSS selector div#page p.summary img and will hide them all.

Very nice feature; should save a lot of time and make Javascript much less painful.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>