开发者

How to loop through all unchecked checkboxes?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜