get current state of check box jquery

This question already has an answer here:

  • How to check whether a checkbox is checked in jQuery? 56 answers

  • 尝试使用.is()函数以及:checked选择器来完成您的任务,

    ckb = $("#ickb").is(':checked');
    

    Use is() with :checked to get the result as boolean that is true if checkbox is checked.

    ckb = $("#ickb").is(':checked');
    

    Or, you can use length, if it is zero then it is not checked.

    ckb = $("#ickb::checked").length
    
    链接地址: http://www.djcxy.com/p/9514.html

    上一篇: 确定复选框是否使用jQuery进行检查

    下一篇: 获取当前状态的复选框jquery