diff options
author | Mathias Bynens <mathias@qiwi.be> | 2012-02-10 17:14:13 +0100 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2012-03-02 13:28:27 -0500 |
commit | 2803a5e6f2704691fdd8ce4d34fe961d0192a0fb (patch) | |
tree | 7962348fa16e70f8faddb47eca92ec19a6b1bdbc /src/attributes.js | |
parent | f0732c1e4138342c96e35ff51d5cd681b6cfdb94 (diff) | |
download | jquery-2803a5e6f2704691fdd8ce4d34fe961d0192a0fb.tar.gz jquery-2803a5e6f2704691fdd8ce4d34fe961d0192a0fb.zip |
Fix #11316. Find valHooks first by element type, then by nodeName.
Reverses the previous search order.
Diffstat (limited to 'src/attributes.js')
-rw-r--r-- | src/attributes.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/attributes.js b/src/attributes.js index 4d15e8054..88ce4df23 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -162,7 +162,7 @@ jQuery.fn.extend({ if ( !arguments.length ) { if ( elem ) { - hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; + hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; @@ -206,7 +206,7 @@ jQuery.fn.extend({ }); } - hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ]; + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { |