$("tr").first().nextAll().click(function () {
$("input[name='chkId']:checkbox").attr('checked',false);
$("#chkAll").attr('checked',false);
$(this).children().first().children().attr("checked", true);
});
我有个这个方法 但是我要排除单击选中第一个td 就是要实现 第一个td的 check点选是多可以多选 但是除了第一个td 点了之后就执行这个方法 求各位大佬帮助
给ajax刷上去的tr加一个class 用于区分标题栏和数据
$(".trEmp td").nextAll().click(function () {
$("input[name='chkId']:checkbox").attr('checked',false);
$("#chkAll").attr('checked',false);
$(this).parent().children().first().children().attr("checked", true);
});
这样就可以了 研究了大半天 终于可以了 不知道有没有人用的上 我就放这边了
修改选择器吧 $("tr td") 因为实质还是点击的td
能不能给table的tr和td加上id属性呢,你的table是怎么绘制的,可否在绘制拼接js的代码中每个tr的td加上id信息。