diff options
author | John Resig <jeresig@gmail.com> | 2009-02-14 22:24:55 +0000 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2009-02-14 22:24:55 +0000 |
commit | 21dde30348fe9bcbd8db8c1b30e470a9e2f39c16 (patch) | |
tree | 0f01fb321c01b833ebb5bba62bda2590a06ae9da /src/selector.js | |
parent | 782b4af76ec080aad93d5c4a15fbc805f3e5960e (diff) | |
download | jquery-21dde30348fe9bcbd8db8c1b30e470a9e2f39c16.tar.gz jquery-21dde30348fe9bcbd8db8c1b30e470a9e2f39c16.zip |
Provide a graceful failover for [name=foo] queries that are looking for non-input/iframe/form elements. Fixes jQuery bug #4081.
Diffstat (limited to 'src/selector.js')
-rw-r--r-- | src/selector.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/selector.js b/src/selector.js index dd0506598..ecec83b9f 100644 --- a/src/selector.js +++ b/src/selector.js @@ -333,8 +333,9 @@ var Expr = Sizzle.selectors = { } }, NAME: function(match, context, isXML){ - if ( typeof context.getElementsByName !== "undefined" && !isXML ) { - return context.getElementsByName(match[1]); + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = context.getElementsByName(match[1]); + return ret.length === 0 ? null : ret; } }, TAG: function(match, context){ |