Removing a Class

$("span").removeClass("oldClass");

You remove classes using the .removeClass([className]) method. For example, to remove the active class from the <span> elements, you call the following:

$("span").removeClass("active");

You can also use remove with no className, which removes all classes from the elements. For example, the following statement removes all classes from <p> elements:

$("p").removeClass();

Get jQuery and JavaScript Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.