使用css来计数选中的多选框数
css
.choose{
counter-reset: checkNo;
}
.choose input:checked{
counter-increment: checkNo;
}
.count:before{
content: counter(checkNo);
}
html
<div class="choose">
<label><input type="checkbox"/>111</label>
<label><input type="checkbox"/>111</label>
<label><input type="checkbox"/>111</label>
<label><input type="checkbox"/>111</label>
<label><input type="checkbox"/>111</label>
<label><input type="checkbox"/>111</label>
<p class="count"></p>
</div>