Select All Checkboxes By ID/Class

后端 未结 8 1879
孤城傲影
孤城傲影 2021-02-07 12:27

I\'m really bad at Javascript and I\'m struggling to get my head round it.

What I\'m trying to do is get something to select all checkboxes. However everything I have fo

8条回答
  •  遥遥无期
    2021-02-07 12:54

    Using JQuery, you can do this very easilly!

    $(".ClassName").attr("checked", "true");
    

    or a single ID

    $("#ID").attr("checked", "true");
    

    See: Check All Checkboxes with JQuery.

提交回复
热议问题