Use a checkbox check box to make the Select All button for multiple checkbox check box, when one check box is not selected, the checked of the button is false, and when all checkboxes are selected, the Select All button is also Selected.
Detailed
There are two ways to make the check box in the <input type= "checkbox"/> selected.
Method one: Add the checked property directly in the HTML rows . eg:<input type= "checkbox" checked/>
Method two: use JavaScript to make the input object checked= "true"; Eg:document.getElementsByTagName (' input ') [0].checked= ' true ';
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>Select All</title><Script>window.onload= function(){ varAinput=document.getElementsByTagName ('input'); varOinput=ainput[0]; vara= 0; varb= 0; ainput[0].onclick= function(){ for (varI= 0; I<ainput.length; i++) { if(ainput[0].checked== true) {ainput[i].checked= true; }Else{ainput[i].checked= false; } } }; for (varI= 1; I<ainput.length; i++) {ainput[i].onclick= function() {a= 0; b= 0; for (varI= 1; I<ainput.length; i++) { if(ainput[i].checked== false) {a++; }Else{b++; } } if(a>0) {oinput.checked= false; }Else if(b==Ainput.length-1) {oinput.checked= true; }; }; }};</Script></Head><Body><P><inputtype= "checkbox"name="" />Select All</P><inputtype= "checkbox"name="" /><BR/><inputtype= "checkbox"name="" /><BR/><inputtype= "checkbox"name="" /><BR/><inputtype= "checkbox"name="" /><BR/><inputtype= "checkbox"name="" /><BR/><inputtype= "checkbox"name="" /><BR/><inputtype= "checkbox"name="" /><BR/><inputtype= "checkbox"name="" /><BR/><inputtype= "checkbox"name="" /><BR/><inputtype= "checkbox"name="" /><BR/><inputtype= "checkbox"name="" /><BR/></Body></HTML>
JS do a select all, Use a checkbox check box to make multiple checkbox check box of the Select button, when there is a check box is not selected, the checked of the All button is False