Why is jQuery's .removeClass() adding a space to the class attribute?

Posted by Sosh on Stack Overflow See other posts from Stack Overflow or by Sosh
Published on 2010-05-25T10:26:31Z Indexed on 2010/05/25 10:31 UTC
Read the original article Hit count: 200

Filed under:

I'm having some strange issues with .removeClass() and .addClass() in jQuery.

Specifically it seems that when I use .removeClass() the class is indeed removed, but a single space is left in it's place. then when I .addClass("secondclass") I get class=" secondclass" (with the space in front).

I'm using jQuery 1.4.1

Is this intended behaviour or a bug? How to stop it?

© Stack Overflow or respective owner

Related posts about jQuery