Jquery + loop through html table rows where checkbox is not set

I have the following loop that searches for checked checkboxes and edits each line accordingly.

 $("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)); }); 

which is the opposite :checked , since I want to scroll the table where the checkbox is not checked?

Thanks in advance.

+4
source share
2 answers

Use : not selector :

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

Just try using Selectors

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

}

+1
source

Source: https://habr.com/ru/post/1485413/


All Articles