jQuery Minute™

…a jQuery Minute™ later and you're done!



addClass() removeClass()

without comments

If you have to add or remove multiple classes with jQuery, the most efficient way is to separate the classes with a space and make one call.

Such as:

1
$('body').addClass('abc def');

As opposed to:

1
$('body').addClass('abc').addClass('def');

Written by jdsharp

December 11th, 2007 at 12:22 pm

Leave a Reply