jQuery + 循环遍历 HTML 表格行,其中复选框未被选中

4
我有以下循环,寻找 已勾选的复选框 并相应地编辑每一行。
$("table.authors-list").find('input[type="checkbox"][name^="treated"]:checked').each(function () {
    var row = $(this).closest('tr'),
        priceInput = row.find('input[name^="transportprice"]');

    priceInput.val(treatedtransportcostperton.toFixed(2));
});  

什么是:checked的相反操作,因为我想循环遍历表格中未选中复选框的行?

提前感谢。

2个回答

5
使用 :not selector
  $("table.authors-list")
     .find('input[type="checkbox"][name^="treated"]:not(:checked)')
     .each(function () {...});

1

我会尝试使用选择器

$("table.authors-list").find('input[type="checkbox"]name^="treated"]:not(:checked)').each(function () {

}


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接