0
js的小新和计数选定的盒子有问题,任何人都可以看到我做错了什么?计数与jquery选定的复选框
小提琴:https://jsfiddle.net/ate9a04u/
JS
$(document).ready(function() {
var maxAllowed = 3;
$(".rmax").html(maxAllowed);
$(".subscribtion-content input.checkbox").change(function() {
var cnt = $(".subscribtion-content input.checkbox:checked").length;
if (cnt > maxAllowed) {
$(this).prop("checked", "");
$(".rcount").html(cnt);
}
});
});
也有反正当达到,反之最大禁用其他人呢?