my script does not work i have added my sourcode below <script> $(function(){ $('selectall-form').click(function(event) { if(this.checked) { $('.bluebutton3').each(function() { this.checked = true; }); } if(!this.checked) { $(':checkbox').each(function() {this.checked = false;}); } }); }); </script> input <input type="checkbox" name="t1" class="checkbox"> <input type="checkbox" name="t2" class="checkbox"> button <input type="button" name="selectall-form" class="bluebutton3" value="Select All">
$(function(){ $('.bluebutton3').click(function(){ var select_all = (this.value === 'Select All'); $('input:checkbox').attr('checked', select_all); this.value = (select_all) ? 'Deselect All' : 'Select All'; }); });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)