I use jquery-1.9.1.js In my html page, it works well for the first time.
just like http://jsfiddle.net/pzCcE/1/
Can somebody help me to improve it?
I've just simplified @j08691 answer
$("#checkAll").click(function() { var allChecked = $(this); $("#tab1 input[type=checkbox]").each(function() { $(this).prop("checked", allChecked.is(':checked')); }) });
Select all book1 book2 book3