Bug Tracker

Opened 10 years ago

Closed 10 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 10 years ago by john

Milestone: 1.4.11.4.2
Owner: set to john
Status: newassigned

comment:3 Changed 10 years ago by john

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