Opened 13 years ago
Closed 13 years ago
#6050 closed bug (fixed)
jQuery 1.4.1 addClass white space issue
Reported by: | slawek | Owned by: | john |
---|---|---|---|
Priority: | Milestone: | 1.4.2 | |
Component: | attributes | Version: | 1.4.1 |
Keywords: | addClass | Cc: | |
Blocked by: | Blocking: |
Description
When working with elements having single class name I've noticed something weird.
Example.
<div id="head" class="head"></div> $('#head').removeClass('head'); <div id="head" class=" "></div> $('#head').addClass('head'); <div id="head" class=" head"></div>
So there's no way to compare element class name against some value let's say
if ($('#head').attr('class') == 'head') { ...
because the name of elemnt class is ' head' not 'head'
won't work for version 1.4.1 but it works OK for 1.3.2
Change History (3)
comment:1 Changed 13 years ago by
Milestone: | 1.4.1 → 1.4.2 |
---|---|
Owner: | set to john |
Status: | new → assigned |
comment:2 Changed 13 years ago by
comment:3 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
http://forum.jquery.com/topic/proposed-fix-for-6050