Two different methods are used to implement the full selection and inverse selection of the checkbox using js:
Method 1:
1: js implements the full selection function of the checkbox:
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 checkbox anti-selection function:
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;
}
}
}