发现一个jq的问题

时间:2024-01-19 12:35:56

用jq对checkbox的checked属性进行操作时,使用$(‘#id’).attr(‘checked’, true);竟然无效,改成$(‘#id’).prop(‘checked’, true);才可以。