How to skip all flags without a flag?

Using jQuery, is there a quick way to skip all unchecked flags on a page with className = "carCheckboxes" .

+3
source share
1 answer

Use the method .each()with the selector :not(:checked). Here are the links:

JQuery.each method reference

JQuery reference: not a selector

JQuery reference: marked selector

$("input.carCheckboxes:not(:checked)").each (function () {
  //your code to loop through each element.
  //$(this) references the current element as a jQuery Object
});
+11
source

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


All Articles