Select All checkboxes using jQuery

前端 未结 15 1614
渐次进展
渐次进展 2020-12-05 06:26

I have the following html code:

    
    

15条回答
  •  天命终不由人
    2020-12-05 07:08

    $(document).ready(function(){
    $('#ckbCheckAll').click(function(event) { 
                if($(this).is(":checked")) {
                    $('.checkBoxClass').each(function(){
                        $(this).prop("checked",true);
                    });
                }
                else{
                    $('.checkBoxClass').each(function(){
                        $(this).prop("checked",false);
                    });
                }   
        }); 
        });
    

提交回复
热议问题