Skip to content
Permalink
Browse files

Fix #11316. Find valHooks first by element type, then by nodeName.

Reverses the previous search order.
  • Loading branch information...
mathiasbynens authored and dmethvin committed Feb 10, 2012
1 parent f0732c1 commit 2803a5e6f2704691fdd8ce4d34fe961d0192a0fb
Showing with 2 additions and 2 deletions.
  1. +2 −2 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 ) {

0 comments on commit 2803a5e

Please sign in to comment.
You can’t perform that action at this time.