O'Reilly logo

jQuery and JavaScript Phrasebook by Brad Dayley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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();

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required