Bug Tracker

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:


When working with elements having single class name I've noticed something weird.


<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 john

Owner: set to john
Status: newassigned

comment:3 Changed 13 years ago by john

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.