javascript - jquery removeClass() not removing all classes -
this question has answer here:
i have element this:
<div class="one 2 three" id="waterhorse">horse</div> when run code in browser console:
$("#waterhorse").removeclass(); i this:
[<div id="waterhorse" class="one 2 three">horse</div>] in other words, doesn't work; doesn't remove classes on element. unfortunately can't reproduce in jsfiddle.
however, can remove specific class:
$("#waterhorse").removeclass("two"); also, remove classes:
$("#waterhorse").removeattr("class"); any idea why latter works remove classes, former doesn't?
seems known problem jquery , jqueryui not playing nicely together:
odd issue jquery .removeclass() not doing anything
http://bugs.jqueryui.com/ticket/9015
the answer above workaround uses .removeattr('class') instead of .removeclass()
Comments
Post a Comment