return ret == null ? undefined : ret;
},
- attrHooks: {
- type: {
- set: function( elem, value ) {
-
- // Support: IE <=11+
- // An input loses its value after becoming a radio
- if ( isIE && value === "radio" && nodeName( elem, "input" ) ) {
- var val = elem.value;
- elem.setAttribute( "type", value );
- if ( val ) {
- elem.value = val;
- }
- return value;
- }
- }
- }
- },
+ attrHooks: {},
removeAttr: function( elem, value ) {
var name,
}
} );
+// Support: IE <=11+
+// An input loses its value after becoming a radio
+if ( isIE ) {
+ jQuery.attrHooks.type = {
+ set: function( elem, value ) {
+ if ( value === "radio" && nodeName( elem, "input" ) ) {
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ };
+}
+
jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
jQuery.attrHooks[ name ] = {
get: function( elem ) {