Here is a link, which is used to check and uncheck the parent checkbox and all the child checkboxes are getting selected and deselected.
jquery check uncheck all checkboxes Using Jquery With Demo
$(function () {
$("#select-all").on("click", function () {
var all = $(this);
$('input:checkbox').each(function () {
$(this).prop("checked", all.prop("checked"));
});
});
});