-1
我使用的是javascript检查所有复选框的功能...它工作正常,但如果我想检查特定复选框1或2或更多,则我得到了所有的数组,但是我没有得到具体的复选框值,请告诉我是否存在javascript或jQuery中的任何函数来执行此操作。检查所有复选框,并检查数组中的特定复选框
var checkflag = "false";
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;
}
checkflag = "true";
return "Uncheck All";
} else {
for (i = 0; i < field.length; i++) {
field[i].checked = false;
}
checkflag = "false";
return "Check All";
}
}