I have an element like this:
<div class="one two three" id="waterhorse">horse</div>
When I run this code in the browser console:
$("#waterhorse").removeClass();
I get this:
[<div id="waterhorse" class="one two three">horse</div>]
In other words, it doesn't work; it doesn't remove any classes on the element. I unfortunately can't reproduce it in jsfiddle.
However, I can remove a specific class:
$("#waterhorse").removeClass("two");
Also, this will remove all classes:
$("#waterhorse").removeAttr("class");
Any idea why the latter works to remove all classes, but the former doesn't?