开发者

How to loop through all unchecked checkboxes?

开发者 https://www.devze.com 2023-01-26 09:07 出处:网络
Using jQu开发者_StackOverflow中文版ery, is there a fast way to loop through all unchecked checkboxes on a page that have className=\"carCheckboxes\".Use the .each() method with the :not(:checked) sele

Using jQu开发者_StackOverflow中文版ery, is there a fast way to loop through all unchecked checkboxes on a page that have className="carCheckboxes".


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

Reference to jQuery.each method

Reference to jQuery:not selector

Reference to jQuery:checked selector

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

精彩评论

暂无评论...
验证码 换一张
取 消