直接上干货
var cbs = document.getElementsByName("flow[]");
var checkNum = 0;
for (var i = 0; i < cbs.length; i++) {
if (cbs[i].checked) {
checkNum++;
}
}
if (checkNum == 0) {
alert('至少选择一个');
}
直接上干货
var cbs = document.getElementsByName("flow[]");
var checkNum = 0;
for (var i = 0; i < cbs.length; i++) {
if (cbs[i].checked) {
checkNum++;
}
}
if (checkNum == 0) {
alert('至少选择一个');
}