attr() doesn't always return a string in jQuery 1.6 and lower
|Reported by:||Andy E||Owned by:||Andy E|
For Internet Explorer 7 and older, attr() may return a boolean or function type for certain attributes, for example "checked" or "onclick" respectively.
This is due to the old getAttribute bug that returns the DOM property value instead of the attribute string, which was finally fixed in IE 8. As a workaround, jQuery should make use of getAttributeNode rather than getAttribute.
This solution can be demonstrated by the following fiddle: http://jsfiddle.net/TbjRN/. Run it in IE's compatibility mode or IE 7 or IE 6.
Change History (10)
comment:1 Changed 6 years ago by rwaldron
- Component changed from unfiled to attributes
- Owner set to timmywil
- Status changed from new to assigned
comment:6 Changed 6 years ago by dmethvin
- Owner changed from timmywil to Andy E
- Status changed from assigned to pending
comment:9 Changed 6 years ago by dmethvin
- Keywords needsdocs added
- Resolution set to wontfix
- Status changed from new to closed