Select All Checkboxes By ID/Class

后端 未结 8 1878
孤城傲影
孤城傲影 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:52

    I always had a tough time with javascript. You might want to investigate the jQuery javascript library. It's greatly enhanced my ability to solve problems using javascript, as well as create more clear and concise code to manipulate and access the DOM.

    With jQuery you should be able to easily select all the checkboxes you'd like by ID and then loop through them setting their value to be checked.

提交回复
热议问题