复选框操作

<script>
    $(function () {
        //查找id=tab的表格,下面所有的tr,下面的所有td,第一个td下面复习框的点击事件。
        $("#tab tr>td:nth-child(1)").find("input[type='checkbox']").bind("click"function () {
            if ($(this).attr("checked") == true) {
                $(this).parent().nextAll().find("input[type='checkbox']").attr("checked"true);
            }
            else {
                $(this).parent().nextAll().find("input[type='checkbox']").attr("checked"false);
            }
        })
    })
</script>
posted @ 2014-06-16 20:22  明济安  阅读(177)  评论(0编辑  收藏  举报