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?
$("input[name='select_all_photos']").click(function () { var checked = $(this).is(':checked'); $("input[name^='delete_']").each(function () { $(this).prop("checked", checked); }); });
Don't bother doing an if statement.