From: timmywil Date: Tue, 19 Apr 2011 21:48:07 +0000 (-0400) Subject: Follow w3c standard for setting the common boolean attributes to the same name(select... X-Git-Tag: 1.6rc1~11^2~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=103d3258876fb55316713ab3e4e743b2f8def54a;p=jquery.git Follow w3c standard for setting the common boolean attributes to the same name(selected, checked, readOnly, and disabled) --- diff --git a/src/attributes.js b/src/attributes.js index d163469c7..ac832591a 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -473,7 +473,10 @@ if ( !jQuery.support.getSetAttribute ) { jQuery.each([ "selected", "checked", "readOnly", "disabled" ], function( i, name ) { jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { set: function( elem, value ) { - if ( value === false ) { + if ( value === true ) { + elem.setAttribute( name, name ); + return value; + } else if ( value === false ) { jQuery.removeAttr( elem, name ); return value; }