.


Divya


onClick Checkbox check all checkboxes jquery with Demo


<!DOCTYPE html>
<html>
<body>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<input type="checkbox" id="checkAll">Select All<br>
<input type="checkbox" id="checkItem">Item 1<br>
<input type="checkbox" id="checkItem">Item 2<br>
<input type="checkbox" id="checkItem">Item 3<br>
<input type="checkbox" id="checkItem">Item 4<br>
<input type="checkbox" id="checkItem">Item 5<br>
<script>
$("#checkAll").click(function () {
$('input:checkbox').not(this).prop('checked', this.checked);
});
</script>
</body>
</html>

Run it yourself

Demo

Select All
Item 1
Item 2
Item 3
Item 4
Item 5


.