Skip to content

Commit

Permalink
Make sure button:submit works, also simplify some of the nodeName acc…
Browse files Browse the repository at this point in the history
…esses.
  • Loading branch information
jeresig committed Apr 12, 2011
1 parent d2d8400 commit b079e80
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sizzle.js
Expand Up @@ -645,7 +645,8 @@ var Expr = Sizzle.selectors = {
},

submit: function( elem ) {
return elem.nodeName.toLowerCase() === "input" && "submit" === elem.type;
var name = elem.nodeName.toLowerCase();
return (name === "input" || name === "button") && "submit" === elem.type;
},

image: function( elem ) {
Expand All @@ -657,8 +658,8 @@ var Expr = Sizzle.selectors = {
},

button: function( elem ) {
return elem.nodeName.toLowerCase() === "input" && "button" === elem.type ||
elem.nodeName.toLowerCase() === "button";
var name = elem.nodeName.toLowerCase();
return name === "input" && "button" === elem.type || name === "button";
},

input: function( elem ) {
Expand Down

0 comments on commit b079e80

Please sign in to comment.