Select all checkbox elements except disabled ones

后端 未结 8 547
暗喜
暗喜 2021-01-18 09:06

I want to select all checkbox elements expect disabled ones,

this is my html



        
8条回答
  •  春和景丽
    2021-01-18 09:28

    Or you may also use the :not selector as follows:

    $('#chkSelectAll').click(function () {
        var checked_status = this.checked;
        $('div#item input[type=checkbox]:not(:disabled)').each(function () {
                   this.checked = checked_status;
        });
    });
    

提交回复
热议问题