//预先重置
$("input[type='checkbox'][name*='no']").prop('checked', true);
$("input[type='checkbox'][name='cert[px]']").prop("checked", false);
$("input[type='radio'][name*='gj']").prop("checked", false);
//获取数据
res.data.data.forEach(function(element, index) {
$("input[type='checkbox'][name*='no']").prop('checked', false);
$("input[type='checkbox'][value='" + element.type + "']").prop("checked", true);
$("input[name='gj'][value='" + element.type + "']").prop("checked", true);
if($("input[name='gj']:checked").length > 0) {
$("input[type='checkbox'][name*='cert[gj]']").prop('checked', true);
}
})
layui 复选框,单选框重置问题
猜你喜欢
转载自blog.csdn.net/qq_40295815/article/details/104799585
今日推荐
周排行