<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
修改後效果測試