Friends say it's not compatible. I went back last night. Debug a compatible version:
Copy Code code as follows:
<meta http-equiv= "Content-type" content= "text/html; CHARSET=GBK ">
<script language= "JavaScript" >
function Selectit (action) {
var Testform=document.getelementbyid ("Bdkey");
for (var i=0; i<testform.elements.length;i++) {
if (testform.elements[i].type== "checkbox") {
E=testform.elements[i];
E.checked= (action== "SelectAll")? 1: (!e.checked);
}
}
}
</script>
<body>
<form name= "Bdkey" id= "Bdkey" >
<p class= "STYLE1" >
Select All
<input type= "checkbox" Name= "SelectAll" value= "checkbox" onclick= "Selectit (' SelectAll ')" ><br>
Anti-election
<input type= "checkbox" name= "Invest" value= "checkbox" onclick= "Selectit ()" ><br>
Item1
<input type= "checkbox" name= "checkbox" value= "checkbox" >
<br>
Item2
<input type= "checkbox" name= "checkbox" value= "checkbox" ><br>
Item3
<input type= "checkbox" name= "checkbox" value= "checkbox" ><br>
Item4
<input type= "checkbox" name= "checkbox" value= "checkbox" ><br>
Item5
<input type= "checkbox" name= "checkbox" value= "checkbox" >
</p>
</form>
</body>
<ptml> <pead> <meta http-equiv= "Content-type" content= "text/html; CHARSET=GBK "> <script language=" javascript > function Selectit (action) {var testform=document.getelementby Id ("Bdkey"); for (var i=0; i<testform.elements.length;i++) {if (testform.elements[i].type== "checkbox") {E=TESTFO Rm.elements[i]; E.checked= (action== "SelectAll")? 1: (!e.checked); }} </script> </pead> <body> <form name= "Bdkey" id= "Bdkey" > <p class= "STYLE1" & Gt All <input type= "checkbox" Name= "SelectAll" value= "checkbox" onclick= "Selectit (' SelectAll ')" > Anti-select <input type = "checkbox" name= "Invest" value= "checkbox" onclick= "Selectit ()" > Item1 <input "checkbox" type= "checkbox" va lue= "checkbox" > Item2 <input type= "checkbox" name= "checkbox" value= "checkbox" > Item3 <input type= "Chec" Kbox "name=" checkbox "value=" checkbox "> Item4 <input type=" checkbox"Name=" checkbox "value=" checkbox "> Item5 <input type=" checkbox "name=" checkbox "value=" checkbox "> </p> </form> </body>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
This compatibility test I just started with a classic JS multiple-selection box selection of the implementation and analysis of the implementation, that is, through ev.srcelement but failed to debug successfully. So there's the way it is now. Compatibility debugging is partly dependent on the way you implement it, like my way is stupid haha but the simplest is often the most effective. Of course, as a technical pursuit of this, we all like to use a lot of advanced methods. I'm not going to be here.