jQuery: how can I select only the checkboxes that are visible and checked?

后端 未结 3 2145
后悔当初
后悔当初 2021-02-15 11:21

I\'m trying to check whether or not all the visible check boxes in a certain series are checked and i thought of just counting those that are visible and those that are visible

3条回答
  •  北恋
    北恋 (楼主)
    2021-02-15 12:14

    This is incorrect:

    if($j("input[id^='chk_camp']").filter(':visible').filter(':checked).length == $j("input[id^='chk_camp']).filter(':visible').length)
    //                                                          ------^------ missing qoutes here      ----^--- also double quotes here
    

提交回复
热议问题