Ticket #9894 (closed bug: worksforme)
jQuery attr() returns undefined in Firefox/Chrome when used on the attribute "value".
|Reported by:||ivolodin@…||Owned by:|
It looks like function attr has been modified in jQuery 1.6.1 to use attrHooks collection. Because of that, if you are trying to retrieve a value of the "value" attribute, it executes the code that does element.value. Line 2193 in jQuery forks the code so that for the attributes within attrHooks it wouldn't use element.getAttribute() function. "value" is allowed attribute for some elements, like input fields, and you can get it through element.value, but for elements like "div" it's a custom attribute, and you can't retrieve it through .value. Please look at the link attached for an example.
Sample here: http://jsfiddle.net/gd2Ms/1/