更新时间:2023-10-17 17:06:22
1.要检查是否已选中复选框,请使用.is(':checked')
像if ($('.accpt_chk').is(':checked')) {}
2.要添加属性,可以使用.attr('name','value')
1.To check whether a checkbox is selected or not you have use .is(':checked')
like if ($('.accpt_chk').is(':checked')) {}
2. To add an attribute you can use .attr('name','value')
更新的Js的一部分
$(document).on('click', ".accpt_chk", function() {
if ($('.accpt_chk').is(':checked')) {
$('.checkfile').attr('disabled', 'true')
} else {
$('.checkfile').removeAttr('disabled')
$('.checkfile').prop('enabled', false);
$(this).closest("#btn_selct").removeClass('cst_select').addClass('cst_select_dis');
//$('#btn_selct').hasClass('.cst_select ').remove().addClass('.cst_select_dis');
}
//$('.qq-upload-button').prop('disabled', !this.checked);
});