Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Check uncheck all checkboxes with jQuery

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


<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>

The Example

Check/Uncheck All
One
Two
Three
Four
Five


This post first appeared on Altaf Hussain's Blog, please read the originial post: here

Share the post

Check uncheck all checkboxes with jQuery

×

Subscribe to Altaf Hussain's Blog

Get updates delivered right to your inbox!

Thank you for your subscription

×