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 *