I need to check one checkbox (checkAll) and select all and if I deselect it all should be deselected too. Additionally, if they are all selected and then I uncheck 'a', 'b' or 'c', 'checkAll' also need to be unchecked.
<input type="checkbox" value="" id="checkAll">
<input type="checkbox" value="a">
<input type="checkbox" value="b">
<input type="checkbox" value="c">
What's the trigger I need to use? Tried but failed:
$("#checkAll").click(function() {
alert('test');
});