Can anyone help me with this?
I have two div
s. In one div
, I have a checkbox named allcheck
, and in the other other div
, I have checkboxes with name outcheck
. If I check multiple
, all need to be checked, and if I uncheck multiple
, all should be unchecked. input radio is class of allcheck
.
$('.inputradio').click(function(){
$("INPUT[name='outCheck']").each(function () {
if (allCheck.checkbox== true) {//multi check is checked
this.checked = true;
} else {
this.checked = false;
}
});
});
HTML
This is the div
for main checkbox
<div id="actions"><div id="box">
<ul><li class="inputradio"><input name="allCheck" type="checkbox" ></li>
<li class="multiple"><a href="#" class="bt btleft">Multiple</a></li>
This is for child checkboxes:
<ul><li id="outcheckbox"><input name="outCheck" type="checkbox"></li>
Even if one child is checked, if we check the main checkbox, all need to be selected. The code I posted is just inverting the check.