4

I have the following loop that looks for checked checkboxes and edits each row 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));
});  

what is the opposite of :checked as I want to loop through the table where the checkbox are not checked?

Thanks in advance.

0

2 Answers 2

5

Use :not selector :

  $("table.authors-list")
     .find('input[type="checkbox"][name^="treated"]:not(:checked)')
     .each(function () {...});
Sign up to request clarification or add additional context in comments.

Comments

1

Just try with Using Selectors

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

}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.