Select All checkbox by Javascript or console

后端 未结 9 1292
野性不改
野性不改 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:17

      function selectAll(elem)
      {
      for (i = 0; i < elem.length; i++)
        elem[i].checked = true ;
      }
    

    On Click of a button call this method and pass the name of the element(checkboxes-they all should be same named).

提交回复
热议问题