aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortimmywil <tim.willison@thisismedium.com>2011-04-19 17:48:07 -0400
committertimmywil <tim.willison@thisismedium.com>2011-04-19 17:48:07 -0400
commit103d3258876fb55316713ab3e4e743b2f8def54a (patch)
tree7dd5fffd6cb202c03052f74cf7c73dc69cd91c90
parent8d2d94cfbab40d3919b4d5e596e589a2be09af1a (diff)
downloadjquery-103d3258876fb55316713ab3e4e743b2f8def54a.tar.gz
jquery-103d3258876fb55316713ab3e4e743b2f8def54a.zip
Follow w3c standard for setting the common boolean attributes to the same name(selected, checked, readOnly, and disabled)
-rw-r--r--src/attributes.js5
1 files changed, 4 insertions, 1 deletions
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;
}