$('#parent1').click(function () {
if ($('#parent1').is(':checked')) {
$('input[type="checkbox"]').attr('checked', true);
} else {
$('input[type="checkbox"]').attr('checked', false);
}
});这个函数虽然不是document.ready(函数)的一部分,但只是第一次工作。
它不适用于后续的点击?这里有遗漏什么吗?任何帮助都将不胜感激。
我所有的子复选框都是父母2,3,4,...15。
<c:forEach var="parent1" items="${model.list}">
<form:checkbox path="list" value="${parent1.name}" label="${parent1.name}" />
</for:each>https://stackoverflow.com/questions/30271511
复制相似问题