I got this code from stackoverflow which looks like a pretty good \"select all\" checkbox solution, any ideas why it fails after 2nd click?
http://jsfiddle.net/R9zj
Try using .attr('checked', 'checked')
.attr('checked', 'checked')
$(document).ready(function () { $(document).on("click", ".selectall2", function () { $(this).closest('tr').find('input[type=checkbox]').attr('checked', 'checked'); }); });