Use js to select all and reverse the checkbox in two different ways:
Method 1:
1: js implements the all-select function of checkbox:
The code copy is as follows:
function checkAll()
{
var code_Values = document.getElementsByTagName("input");
for(i = 0;i < code_Values.length;i++){
if(code_Values[i].type == "checkbox")
{
code_Values[i].checked = true;
}
}
}
2: js implements the anti-select function of checkbox:
The code copy is as follows:
function uncheckAll()
{
var code_Values = document.getElementsByTagName("input");
for(i = 0;i < code_Values.length;i++){
if(code_Values[i].type == "checkbox")
{
code_Values[i].checked = false;
}
}
}