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

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -