Select All checkbox by Javascript or console

后端 未结 9 1298
野性不改
野性不改 2021-01-31 05:01

I am having 100 Checkboxes on my web page. For testing purposes I want to tick all those boxes, but manually clicking is time consuming. Is there a possible way to get them tick

9条回答
  •  清歌不尽
    2021-01-31 05:19

    querySelectorAll is your best choice here if you don't want jQuery!

    var ele = document.querySelectorAll("input[type=checkbox]");
    for(var i=0;i

提交回复
热议问题