Skip to main content

Bug Tracker

Side navigation

#5341 closed bug (invalid)

Opened October 08, 2009 03:04PM UTC

Closed December 02, 2010 08:07AM UTC

attr method - attribute via the DOM 0 way in IE

Reported by: strikedaemon Owned by: strikedaemon
Priority: minor Milestone: 1.4
Component: core Version: 1.3.2
Keywords: attr Cc:
Blocked by: Blocking:

when setting a non string attribute using the attr method in IE like so:

$('#elem').attr('att', true);

if the attribute doesn't exist then the value of true (boolean) becomes the string 'true'.

but, if you set it a second time (the attribute now exists) then the attribute assumes the value of true (boolean) instead of 'true' (string).

this behavior only happens in IE because the following condition in the attr method is true when an attribute exists (even though it's never true in firefox or chrome).

if ( name in elem && notxml && !special ) { ...

this situation happens, of course, for any kind of object (not just boolean values).

Attachments (0)
Change History (2)

Changed November 01, 2010 05:51AM UTC by snover comment:1

owner: → strikedaemon
status: newpending

Could you please provide a test case demonstrating this issue, as well as a use case detailing why it is a problem?

Changed December 02, 2010 08:07AM UTC by trac-o-bot comment:2

resolution: → invalid
status: pendingclosed

Automatically closed due to 14 days of inactivity.