Use jQuery prop function to check or uncheck form check boxes.
Its javascript version is available in another article named Check uncheck all checkboxes with javascript
The Html Form
The Example
Its javascript version is available in another article named Check uncheck all checkboxes with javascript
The Html Form
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> </script>
<script type="text/javascript">
$(document).ready(function(e) {
$('#checkAll').click(function(){
$('input:checkbox').prop('checked', this.checked);
});
});
</script>
<form name="checkForm">
<input type="checkbox" id="checkAll">Check/Uncheck All
<input type="checkbox" name="one" value ="one">One
<input type="checkbox" name="two" value ="two">Two
<input type="checkbox" name="three" value ="three">Three
<input type="checkbox" name="four" value ="four">Four
<input type="checkbox" name="five" value ="five">Five
</form>
Check/Uncheck All
One
Two
Three
Four
Five
One
Two
Three
Four
Five