I have added check-boxes dynamically to all the element and successfully added the functionality to select all checkboxes but not able to do the selection for the parent chi
The following will check all children checkboxes, deeper than 1 level using find rather than children.
find
children
$(document.body).on('change', 'input[type=checkbox]', function(){ if($(this).is(':checked')){ $(this).find('input[type="checkbox"]').prop('checked', true); } });