Permalink
Browse files

Follow w3c standard for setting the common boolean attributes to the …

…same name(selected, checked, readOnly, and disabled)
  • Loading branch information...
1 parent 8d2d94c commit 103d3258876fb55316713ab3e4e743b2f8def54a timmywil committed Apr 19, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/attributes.js
View
@@ -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 );
@jdalton

jdalton Apr 19, 2011

Member

Woot, this is wut I do as well.

+ return value;
+ } else if ( value === false ) {
jQuery.removeAttr( elem, name );
return value;
}

0 comments on commit 103d325

Please sign in to comment.