aboutsummaryrefslogtreecommitdiffstats
path: root/src/attributes.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2009-07-19 13:21:51 +0000
committerJohn Resig <jeresig@gmail.com>2009-07-19 13:21:51 +0000
commit0d5c3a68a092401089c9242bdafdb1b2534feb6a (patch)
tree0b52439fb625115252239bbbf66cfc39d0fae9ae /src/attributes.js
parenta3b8ac413f9c55994922c20b39223ab9ae6d1afa (diff)
downloadjquery-0d5c3a68a092401089c9242bdafdb1b2534feb6a.tar.gz
jquery-0d5c3a68a092401089c9242bdafdb1b2534feb6a.zip
Standardizing on .test() and .exec() - moving away from using .match() for RegExp. Fixes jQuery bug #4113.
Diffstat (limited to 'src/attributes.js')
-rw-r--r--src/attributes.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/attributes.js b/src/attributes.js
index 9e66df0ce..041bb29fc 100644
--- a/src/attributes.js
+++ b/src/attributes.js
@@ -214,7 +214,7 @@ jQuery.extend({
if ( name in elem && notxml && !special ) {
if ( set ){
// We can't allow the type property to be changed (since it causes problems in IE)
- if ( name == "type" && elem.nodeName.match(/(button|input)/i) && elem.parentNode )
+ if ( name == "type" && /(button|input)/i.test(elem.nodeName) && elem.parentNode )
throw "type property can't be changed";
elem[ name ] = value;
@@ -230,9 +230,9 @@ jQuery.extend({
var attributeNode = elem.getAttributeNode( "tabIndex" );
return attributeNode && attributeNode.specified
? attributeNode.value
- : elem.nodeName.match(/(button|input|object|select|textarea)/i)
+ : /(button|input|object|select|textarea)/i.test(elem.nodeName)
? 0
- : elem.nodeName.match(/^(a|area)$/i) && elem.href
+ : /^(a|area)$/i.test(elem.nodeName) && elem.href
? 0
: undefined;
}