I have checkbox set with Category Subcategorywise...
Company
Microsoft
Apple
Country
USA
UK
and checkbox attached to e
See simple demo here: http://jsfiddle.net/Pfmuq/2/ or simpler: http://jsfiddle.net/Pfmuq/3/
Please note id should always be unique at all times, rest when you will read the code I have noticed a pattern in your parent and Sub naming hence I took that under account.
please note I also took liberty to switch over your id and class anyhoo code is below :)
Rest hope this helps, :)
code
$('input[name="Company"],input[name="Country"]').click(function(){
if ($(this).is(':checked')){
$(this).nextAll('input[name="'+this.name+'Sub"]').prop('checked',true);
} else {
$(this).nextAll('input[name="'+this.name+'Sub"]').prop('checked',false);
}
});
code from 2nd demo
$('input[name="Company"],input[name="Country"]').click(function(){
$(this).nextAll('input[name="'+this.name+'Sub"]').prop('checked',this.checked);
});
HTML
Company
Microsoft
Apple
Country
USA
UK