X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fattributes.js;h=041bb29fcd3e8fb814fdb04f9291f6a53a6784bd;hb=0d5c3a68a092401089c9242bdafdb1b2534feb6a;hp=9e66df0ce99b14183688eeedbdaba72e7484fce8;hpb=a3b8ac413f9c55994922c20b39223ab9ae6d1afa;p=jquery.git diff --git a/src/attributes.js b/src/attributes.js index 9e66df0..041bb29 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; }