tags:

views:

139

answers:

1

similar to to this here...

http://www.shawnolson.net/a/503/altering-css-class-attributes-with-javascript.html

i know i can change each element's style's individually, but i want to change a lot of elements styles at the same time, and the browser seems to struggle over about 40 elements.

thanks :)

+2  A: 

Yes it can, quite easily.

$$('.someClass').addClass('newClass');

This will add newClass to every someClass element - in your case the 40 elements you have.

This is the literal answer to your question.

That said, I believe what you're really trying to do is generate a specific CSS class on the fly.

And that's something far more complicated. I suggest using this MooTools plugin: http://mootools.net/forge/p/moocss

Oskar Krawczyk
significance