Finding all checkboxes are checked in jQuery

后端 未结 2 1117
囚心锁ツ
囚心锁ツ 2020-12-14 07:51

I have a collection of checkboxes

 
 
 <         


        
2条回答
  •  我在风中等你
    2020-12-14 08:21

    Like this:

    if (!$('input.paid[type=checkbox]:not(:checked)').length)
        do('stuff');
    

    This will check if there are any that are unchecked, and do stuff if there aren't (i.e. they are all checked).

提交回复
热议问题