diff options
author | timmywil <tim.willison@thisismedium.com> | 2011-05-18 11:46:22 -0400 |
---|---|---|
committer | timmywil <tim.willison@thisismedium.com> | 2011-05-18 11:46:22 -0400 |
commit | 25118e22a204c5396f1265feb5cbfd71f35033e3 (patch) | |
tree | 55bae571f803ad9db0a7d4448f3fea744e2011a0 /src | |
parent | ba90af0dc5b279d785e49ff5c051073d2178d372 (diff) | |
download | jquery-25118e22a204c5396f1265feb5cbfd71f35033e3.tar.gz jquery-25118e22a204c5396f1265feb5cbfd71f35033e3.zip |
Handle unset value attributes consistently depending on property existence. Supplements #9328.
Diffstat (limited to 'src')
-rw-r--r-- | src/attributes.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/attributes.js b/src/attributes.js index bb2c2f7d8..ba820145a 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -343,8 +343,8 @@ jQuery.extend({ return value; } - } else if ( hooks && "get" in hooks && notxml ) { - return hooks.get( elem, name ); + } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { + return ret; } else { @@ -495,12 +495,13 @@ boolHook = { // Use the formHook for button elements in IE6/7 (#1954) jQuery.attrHooks.value = { get: function( elem, name ) { + var ret; if ( formHook && jQuery.nodeName( elem, "button" ) ) { return formHook.get( elem, name ); } return name in elem ? elem.value : - elem.getAttribute( name ); + null; }, set: function( elem, value, name ) { if ( formHook && jQuery.nodeName( elem, "button" ) ) { |