Bug Tracker

Opened 13 years ago

Closed 12 years ago

#5341 closed bug (invalid)

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).

Change History (2)

comment:1 Changed 12 years ago by snover

Owner: set to 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?

comment:2 Changed 12 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Automatically closed due to 14 days of inactivity.

Note: See TracTickets for help on using tickets.