| @@ 8367-8380 (lines=14) @@ | ||
| 8364 | } ); |
|
| 8365 | ||
| 8366 | // Radios and checkboxes getter/setter |
|
| 8367 | jQuery.each( [ "radio", "checkbox" ], function() { |
|
| 8368 | jQuery.valHooks[ this ] = { |
|
| 8369 | set: function( elem, value ) { |
|
| 8370 | if ( jQuery.isArray( value ) ) { |
|
| 8371 | return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); |
|
| 8372 | } |
|
| 8373 | } |
|
| 8374 | }; |
|
| 8375 | if ( !support.checkOn ) { |
|
| 8376 | jQuery.valHooks[ this ].get = function( elem ) { |
|
| 8377 | return elem.getAttribute( "value" ) === null ? "on" : elem.value; |
|
| 8378 | }; |
|
| 8379 | } |
|
| 8380 | } ); |
|
| 8381 | ||
| 8382 | ||
| 8383 | ||
| @@ 7678-7691 (lines=14) @@ | ||
| 7675 | } ); |
|
| 7676 | ||
| 7677 | // Radios and checkboxes getter/setter |
|
| 7678 | jQuery.each( [ "radio", "checkbox" ], function() { |
|
| 7679 | jQuery.valHooks[ this ] = { |
|
| 7680 | set: function( elem, value ) { |
|
| 7681 | if ( jQuery.isArray( value ) ) { |
|
| 7682 | return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); |
|
| 7683 | } |
|
| 7684 | } |
|
| 7685 | }; |
|
| 7686 | if ( !support.checkOn ) { |
|
| 7687 | jQuery.valHooks[ this ].get = function( elem ) { |
|
| 7688 | return elem.getAttribute( "value" ) === null ? "on" : elem.value; |
|
| 7689 | }; |
|
| 7690 | } |
|
| 7691 | } ); |
|
| 7692 | ||
| 7693 | ||
| 7694 | ||