check/uncheck all checkboxes

后端 未结 4 1697
别跟我提以往
别跟我提以往 2021-01-21 02:45

I am trying to have a checkbox that checks/unchecks all the other checkboxes.

I am using this code:

$(\"#checkall\").toggle(   
    function () {
          


        
4条回答
  •  甜味超标
    2021-01-21 03:27

    You can try with this

    $("#checkall").click(function() {
       $(".kselItems").prop('checked', this.checked);
    });
    

提交回复
热议问题