How to count check-boxes using jQuery?

前端 未结 5 1939
春和景丽
春和景丽 2020-12-13 02:20

I have tons of checkboxes that are either checked (checked=\"checked\") or unchecked.

I would like to get the number of all checkboxes, unchecked and ch

5条回答
  •  执笔经年
    2020-12-13 02:42

    The following code worked for me.

    $('input[name="chkGender[]"]:checked').length;
    

提交回复
热议问题