Only use getAttributeNode on buttons when setting value

This commit is contained in:
timmywil 2011-04-19 13:17:38 -04:00
parent 3a3842c669
commit 825d3d96ce
2 changed files with 5 additions and 1 deletions

View file

@ -435,6 +435,9 @@ if ( !jQuery.support.getSetAttribute ) {
// And the name attribute
formHook = jQuery.attrHooks.name = jQuery.attrHooks.value = jQuery.valHooks.button = {
get: function( elem, name ) {
if ( name === "value" && !jQuery.nodeName( elem, "button" ) ) {
return elem.getAttribute( name );
}
var ret = elem.getAttributeNode( name );
// Return undefined if not specified instead of empty string
return ret && ret.specified ?