I have checkbox set with Category Subcategorywise...
Company
Microsoft
Apple
Country
USA
UK
and checkbox attached to e
If you can modify your HTML a little, you can come up with a general solution that will work with as many groups as you like (rather than just Country and Company).
HTML:
Company
Microsoft
Apple
Country
USA
UK
JavaScript:
$(function(){
$('.entityCheckboxHeader').click(function() {
$('[name="'+this.name+'Sub"]').prop('checked', this.checked);
});
});
If you're not in a position to modify your HTML then the answer from Tats_innit is a nice, concise solution.
There's a JSFiddle of this solution here: http://jsfiddle.net/L5qqb/