[javascript] Select All checkboxes using jQuery

Add jquery-2.1.0.min.js file

<script src="https://code.jquery.com/jquery-2.1.0.min.js"></script>

Write the codes given below:

<script>
$(document).ready(function () {   
    $("#checkAll").change(function() {
        var checked = $(this).is(':checked'); // Get Checkbox state
        if (this.checked) //If true then checked all checkboxes
           $(".classofyourallcheckbox").prop('checked', true);
        else
           $(".classofyourallcheckbox").prop('checked', false); //or uncheck all textboxes 
    }); 
});
</script>