Selecting multiple classes with jQuery

I’ve had a good look and can’t seem to find out how to select all elements matching certain classes in one jQuery selector statement such as this:

$('.myClass', '.myOtherClass').removeClass('theclass');

Any ideas on how to achieve this? The only other option is to do

$('.myClass').removeClass('theclass');
$('.myOtherClass').removeClass('theclass');

But I’m doing this with quite a few classes, so it requires much code.

4 Answers
4

Leave a Comment