jquery array checkbox

Posted by text on Stack Overflow See other posts from Stack Overflow or by text
Published on 2010-05-17T09:56:03Z Indexed on 2010/05/17 10:00 UTC
Read the original article Hit count: 203

Filed under:
var others = $("#6");
others.click(function() {
    $('input:checkbox').attr('checked',false);
    $("#6").attr('checked',true);
});

I have an array of check boxes which is drawn from database. I want to uncheck other check boxes when a certain check box is ticked in my case checkbox with id #6, and it uncheck a checkbox #6 if other checkbox is check.

The code above is able to uncheck other checkbox but how can I uncheck the checkbox with id 6,once the other checkbox is check.

© Stack Overflow or respective owner

Related posts about JavaScript