Checkbox prop does not trigger change event

The code is as follows, the checkBox here only checks the box

$("#checkBox").prop("checked",true);
$("#checkBox").change(function(){
    
    
    console.log(1);
});
$("#checkBox").prop("checked",true).change();

This is because prop only changes the properties of the check box and does not trigger the change behavior bound to the check box dom.

Guess you like

Origin blog.csdn.net/qq_38110067/article/details/122869291