Ticket #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: | |
| 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
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

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