<script> $(".selectleft").toggle( function() { $(this).parent().find("input[type=checkbox]").attr('checked',true); $(this).val("清空"); return false; }, function() { $(this).parent().find("input[type=checkbox]").attr('checked',false); $(this).val("全选"); return false; } ) </script>
(修改后的代码)jquery
修改后效果测试