Bug Tracker

Ticket #5341 (closed bug: invalid)

Opened 5 years ago

Last modified 4 years ago

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:
Blocking: Blocked by:

Description

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

comment:1 Changed 4 years ago by snover

  • Owner set to strikedaemon
  • Status changed from new to pending

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 4 years ago by trac-o-bot

  • Status changed from pending to closed
  • Resolution set to invalid

Automatically closed due to 14 days of inactivity.

Note: See TracTickets for help on using tickets.