[jQuery] removeClass fails when first class in className is prefixed by space
Hi there, I found this little bug in jQuery that prevents removeClass from
working
when there is a space just before the name of the class. Eg it will not work
on this element: <div class=" myClass1">
The funny thing is that jQuery is the culprit creating the space: It is left
there when you apply removeClass to the first of two or more classes on an
element.
This snippit recreates the problem and shows the className still present
even after calling removeClass:
$(myDiv).addClass("myClass1");
$(myDiv).addClass("myClass2");
$(myDiv).removeClass("myClass1");
$(myDiv).removeClass("myClass2");
alert(divText.outerHTML);
(Was tested in IE only. Sorry, don't have access to others at mo)
--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/