Claudio Poli schrieb:
> Milian Wolff wrote:
>> Am Samstag, 09. September 2006 15:22 schrieb Claudio Poli:
>>> hi,
>>> what's the best way to select/deselect checkboxes in a form with jquery?
>>> can anyone provide a sample code, please?
>>>
>>> thanks in advance.
>> I'd do it like this:
>>
>>     $("[EMAIL PROTECTED]'checkbox']").each(function(){
>>         this.checked = !$this.checked;
>>     }
>>
>> Not tested, but you should get the idea.
> 
> thanks, will it works in IE? I've read that there's an "each" bug around..


Yes, in general each() is OK, in IE as well, apart from some certain 
circumstances using each in XML, with a context passed to the $ function.

There's a small typo by the way, should read: this.checked = !this.checked;


-- Klaus

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to