Pages

Wednesday, October 26, 2016

Check All checkboxes with single Checkbox

<input type="checkbox" id="checkAll">Check All
<hr />
<input type="checkbox" class="checkboxes">Item 1
<input type="checkbox" class="checkboxes">Item 2
<input type="checkbox" class="checkboxes">Item3


<script type="text/javascript">
$('#checkAll').on('click',function(){
$('.checkboxes').not(this).prop('checked', this.checked);
});
</script>

No comments:

Post a Comment