diff options
author | timmywil <tim.willison@thisismedium.com> | 2011-04-17 18:15:20 -0400 |
---|---|---|
committer | timmywil <tim.willison@thisismedium.com> | 2011-04-17 18:17:31 -0400 |
commit | 34d80709ce9bd583f6f5dd17e9bffa2fb7cff3c5 (patch) | |
tree | e96347967ab5ee24decd3b7e4674d44abecf8ecf /src | |
parent | 15da298f72bf94a95563abc12b8e6fec8c604099 (diff) | |
download | jquery-34d80709ce9bd583f6f5dd17e9bffa2fb7cff3c5.tar.gz jquery-34d80709ce9bd583f6f5dd17e9bffa2fb7cff3c5.zip |
Fix value attribute and val for value on button elements. Fixes #1954
Diffstat (limited to 'src')
-rw-r--r-- | src/attributes.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/attributes.js b/src/attributes.js index 374196e12..794b98d75 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -158,7 +158,7 @@ jQuery.fn.extend({ if ( elem ) { hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; - if ( hooks && "get" in hooks && (ret = hooks.get( elem )) !== undefined ) { + if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } @@ -197,7 +197,7 @@ jQuery.fn.extend({ hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ]; // If set returns undefined, fall back to normal setting - if ( !hooks || ("set" in hooks && hooks.set( this, val ) === undefined) ) { + if ( !hooks || ("set" in hooks && hooks.set( this, val, "value" ) === undefined) ) { this.value = val; } }); @@ -433,7 +433,7 @@ if ( !jQuery.support.getSetAttribute ) { // Use this for any attribute on a form in IE6/7 // And the name attribute - formHook = jQuery.attrHooks.name = { + formHook = jQuery.attrHooks.name = jQuery.attrHooks.value = jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); // Return undefined if not specified instead of empty string |