Check if checkbox is checked with jQuery

后端 未结 23 3048
忘了有多久
忘了有多久 2020-11-21 23:12

How can I check if a checkbox in a checkbox array is checked using the id of the checkbox array?

I am using the following code, but it always returns the count of ch

23条回答
  •  北海茫月
    2020-11-22 00:05

    This is also an idea I use frequently:

    var active = $('#modal-check-visible').prop("checked") ? 1 : 0 ;
    

    If cheked, it'll return 1; otherwise it'll return 0.

提交回复
热议问题