I'm trying to keep either "All" and a group of checkboxes (1,2,3) is unchecked. For example, when "All" and "1" are checked, if I click "All", "1" should be unchecked, and vice versa.
<input type="checkbox" name="checkAll" class="selectAll" /> All <br/>
<input type="checkbox" name="checkuser" class="cb_box " /> 1
<input type="checkbox" name="checkuser" class="cb_box " /> 2
<input type="checkbox" name="checkuser" class="cb_box " /> 3
I tried in this way but it doesn't work. Any suggestion?
$(function(){ $('.selectAll').click(function(){ $('input[name=checkuser]').attr('unchecked', $(this).attr('checked')); });
Aucun commentaire:
Enregistrer un commentaire