How to remove all classes with jQuery?
Just use
jQuery('selector').removeClass();
to remove all the classes.
Use attr()
:
selector$.attr("class", "");
From the documentation:
If a class name is included as a parameter, then only that class will be removed from the set of matched elements. If no class names are specified in the parameter, all classes will be removed.
So simply using:
$('#whatever').removeClass();
will remove all classes from #whatever
.