rtype = /^(?:button|input)$/i,
rfocusable = /^(?:button|input|object|select|textarea)$/i,
rclickable = /^a(?:rea)?$/i,
+ special = /^(?:data-|aria-)/,
formHook;
jQuery.fn.extend({
if ( value !== undefined ) {
- if ( value === null || value === false ) {
+ if ( value === null || (value === false && !special.test( name )) ) {
jQuery.removeAttr( elem, name );
return undefined;
return ret;
} else {
- if( value === true ){
+ if( value === true && !special.test( name ) ){
value = name;
}
elem.setAttribute( name, "" + value );