.removeClass() removes one or more CSS class names from each matched element (since jQuery 1.0). Named classes are stripped; others stay. With no arguments, every class is cleared.
Syntax
Start with these common calls. Keep them short and readable.
Learn jQuery .removeClass(): strip one, some, or all CSS class names from matched elements, string array and callback forms, examples, pitfalls, and FAQs.
Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.
Parameters
Parameter
Description
Step 1
Select the element(s) with a jQuery selector.
Step 2
Call .removeClass("name") — or a space list / array / callback.
Step 3
Omit arguments only when you truly want every class gone.
Return Value
Return Value
Description
jQuery object
Most setters and traversing helpers return the jQuery collection so you can chain more methods.
Value / undefined
Getters usually return a value from the first matched element, or undefined when nothing applies.
Result. The element no longer has stylesheet class hooks.
Scope. Only matched elements are cleared — others are untouched.
Frequently Asked Questions
.removeClass() strips one or more CSS class names from each matched element. Other classes stay. With no arguments, it removes every class from each match.
.removeClass() with no args clears the entire class attribute on every matched element. Use sparingly. To replace all classes with one new name, prefer .attr('class', 'newClass').
Yes. Pass a space-separated string — removeClass('blue under') — or since jQuery 3.3 an array — removeClass(['blue', 'under']).
Since jQuery 1.4 you can pass function(index, className). jQuery calls it once per element and removes the returned class name(s). Since 3.3 the callback may return an array.
.removeClass() always strips. .addClass() always appends. .toggleClass() flips presence. Chain removeClass().addClass() to switch exclusive states.
Yes, since jQuery 1.12/2.2 it updates the class attribute and supports SVG and XML elements.