Try

$("#selectAll").click(function(){
    var self = this;
    $(".chkConv").each(function() {
       this.checked = self.checked;
    });
});

or

$("#selectAll").click(function(){
    var s = this;
    $(".chkConv").attr('checked', s.checked ? 'checked' : '');
});

Actually your own code should work fine. If neither works there is
something wrong with your page. I pasted your code as it is and works
on 1.3.1:
http://jquery.nodnod.net/cases/81

cheers,
- ricardo

On Jan 28, 2:35 pm, AndreMiranda <acymira...@gmail.com> wrote:
> Hi everyone!!
>
> I have one checkbox named 'selectAll' that when it's clicked, it
> checks all checkbox below it. And these checkboxes have the same class
> attribute. Like this:
>
> $("#selectAll").click(function() {
>             if ($(this).is(":checked"))
>                 $(".chkConv").each(function() { this.checked =
> true; });
>             else
>                 $(".chkConv").each(function() { this.checked =
> false; });
>         });
>
> This used to work just fine in 1.2.6. I've tried run it in 1.3.1, but
> it doesn't work... just the FIRST checkbox with class attribute
> "chkConv" is checked and the other ones remain unchecked.
>
> Does anyone know why this is happening in this new version of jQuery??
>
> Thanks in advance!!

Reply via email to