This should work:
$('.myClass, .myOtherClass').removeClass('theclass');
You must add the multiple selectors all in the first argument to $(), otherwise you are giving jQuery a context in which to search, which is not what you want.
It’s the same as you would do in CSS.
More Related Contents:
- How can I know which radio button is selected via jQuery?
- Selecting and manipulating CSS pseudo-elements such as ::before and ::after using javascript (or jQuery)
- Should all jquery events be bound to $(document)?
- jQuery selector regular expressions
- Is there a case insensitive jQuery :contains selector?
- Assign click handlers in for loop
- How can I select an element by name with jQuery?
- jQuery selector for inputs with square brackets in the name attribute
- jQuery get specific option tag text
- document.getElementById vs jQuery $()
- jQuery to loop through elements with the same class
- Select all elements that have a specific CSS, using jQuery
- How to get all options of a select using jQuery?
- jQuery function to get all unique elements from an array?
- JQuery .on() method with multiple event handlers to one selector
- Get index of clicked element in collection with jQuery
- Case insensitive jQuery attribute selector
- jQuery Selector + SVG Incompatible?
- Count immediate child div elements using jQuery
- Store jquery selector in variable
- jQuery: Check if div with certain class name exists
- Is there a ‘has focus’ in JavaScript (or jQuery)?
- jQuery :contains(), but to match an exact string
- Getting a jQuery selector for an element
- In jQuery, is selecting by class or id faster than selecting by some other attribute?
- Find HTML based on partial attribute
- Getting the “match” object in a Custom Filter Selector in jQuery 1.8
- jQuery difference between :eq() and :nth-child()
- jQuery selector to target any class name (of multiple present) starting with a prefix?
- Why do functional pseudos such as :not() and :has() allow quoted arguments?