From 34d80709ce9bd583f6f5dd17e9bffa2fb7cff3c5 Mon Sep 17 00:00:00 2001 From: timmywil Date: Sun, 17 Apr 2011 18:15:20 -0400 Subject: Fix value attribute and val for value on button elements. Fixes #1954 --- src/attributes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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 -- cgit v1.2.3