X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fattributes.js;h=93e043368c1cfe5f98a8cdb04a755d21f14adf14;hb=b7d4e0e46cb2cad6f400173cd09ce44d1b8ad04e;hp=de1d331b0f1c239b398494e8e4d9dcaeedb73680;hpb=48e9a3999596c2ee1f4470a78637de8f27e3b219;p=jquery.git diff --git a/src/attributes.js b/src/attributes.js index de1d331..93e0433 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -100,15 +100,13 @@ jQuery.fn.extend({ return; if ( jQuery.isArray(val) && /radio|checkbox/.test( this.type ) ) - this.checked = (jQuery.inArray(this.value, val) >= 0 || - jQuery.inArray(this.name, val) >= 0); + this.checked = jQuery.inArray(this.value || this.name, val) >= 0; else if ( jQuery.nodeName( this, "select" ) ) { var values = jQuery.makeArray(val); jQuery( "option", this ).each(function(){ - this.selected = (jQuery.inArray( this.value, values ) >= 0 || - jQuery.inArray( this.text, values ) >= 0); + this.selected = jQuery.inArray( this.value || this.text, values ) >= 0; }); if ( !values.length )