} else {
- if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem )) !== undefined ) {
+ if ( hooks && "get" in hooks && notxml && ((ret = hooks.get( elem )) !== undefined || name === "tabIndex") ) {
return ret;
} else {
}
},
- // removeAttribute returns boolean in IE6/7
- // set property to null in that case
+ // removeAttribute returns boolean in IE
+ // set property to null if getSetAttribute not supported (IE6-7)
removeAttr: function( elem, name ) {
- if ( typeof elem.removeAttribute( name ) === "boolean" ) {
- elem.setAttribute( name, null );
+ name = jQuery.attrFix[ name ] || name;
+ if ( typeof elem.removeAttribute( name ) === "boolean" && !jQuery.support.getSetAttribute ) {
+ // Setting className to null sets a class of "null"
+ name === "className" ? elem.className = "" : elem.setAttribute( name, null );
}
},
frameborder: "frameBorder"
});
- // Action attribute in ie6/7 returns form object
+ // Action attribute in ie6/7 returns form objects
jQuery.attrHooks.action = jQuery.extend( jQuery.attrHooks.action, {
get: function( elem ) {
return elem.nodeName === "FORM" ? elem.getAttributeNode("action").nodeValue : elem.getAttribute("action");
// Remove certain attrs if set to false
jQuery.each([ "selected", "checked", "readonly", "disabled" ], function( i, name ) {
name = jQuery.attrFix[ name ] || name;
-
+
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
set: function( elem, value ) {
if ( !value ) { // '', undefined, false, null will remove attr
// Make sure that a selected-by-default option has a working selected property.
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
optSelected: opt.selected,
-
+
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
getSetAttribute: div.className !== "t",
// Will be defined later