平时我们会遇到全选/全取消,代码如下;
<script type="text/javascript"> $("#selectall").change( function () { var ischecked = $(this ).prop("checked"); $( ".msglists").each(function () { $( this).find("input[type=checkbox]" ).prop("checked", ischecked); $( "#selec").prop("checked" , ischecked); }); renewtotalpriceandcount(); }); </script>
原文:http://www.cnblogs.com/WZH75171992/p/4160385.html