jquery select all checkboxes

前端 未结 19 2636
情书的邮戳
情书的邮戳 2020-12-13 12:36

I have a series of checkboxes that are loaded 100 at a time via ajax.

I need this jquery to allow me to have a button when pushed check all on screen. If more are lo

相关标签:
19条回答
  • 2020-12-13 13:40

    I could not get this last example to work for me. The correct way to query the state of the checkbox is apparently :

    var status = $(this).prop("checked");
    

    and not

    var status = $(this).attr("checked") ? "checked" : false;
    

    as above.

    See jQuery receiving checkbox status

    0 讨论(0)
提交回复
热议问题