复选框全选控制
程序员文章站
2024-02-05 13:47:58
...
<script type="text/plain" id="schClearTemplaet">
<div class="form-group" id = "clearZT">
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" name="ZT" value="1" id="schClear1">
<label class="form-check-label" for="schClear1">清空导入数据</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" name="ZT" value="2" id="schClear2">
<label class="form-check-label" for="schClear2">清空分析结果</label>
</div>
</div>
<hr>
<div class="form-group" id="schClearSubject">
<div class="form-check mb-2">
<input class="form-check-input" type="checkbox" id="schAllClear" style="top: -5px;">
<label class="form-check-label" for="schAllClear">全选</label>
</div>
{{each examinationStatus item}}
<div class="form-check mb-1">
<input class="form-check-input" type="checkbox" name="subjects" id="subjectChickbox{{item.paper.paperCode}}" value="{{item.paper.paperCode}}" style="top: -5px;">
<label class="form-check-label" for="subjectChickbox{{item.paper.paperCode}}">{{item.paper.subject.name}}</label>
<p class="float-right">{{item.paper.paperName}}</p>
</div>
{{/each}}
</div>
</script>
$('#schAllClear').on('click',function(){
if(this.checked) {
$("#schClearSubject input[name='subjects']").prop('checked',true);
}else {
$("#schClearSubject input[name='subjects']").prop('checked',false);
}
});
上一篇: 【原】超简单类型转换(DataTable
下一篇: php gd实现下载图片