Js
1<script>2Window.onload=function(){ 3 varOther=document.getelementbyid (' other '));4 varOcheck=document.getelementbyid (' All ');5 varOno=document.getelementbyid (' uncheck ');6 varOdiv=document.getelementbyid (' box ');7 varAcheck=odiv.getelementsbytagname (' Input ');8ocheck.onclick=function(){9 for(i=0;i<acheck.length;i++){TenAcheck[i].checked=true; One }; A }; -ono.onclick=function(){ - for(i=0;i<acheck.length;i++){ theAcheck[i].checked=false; - }; - }; -other.onclick=function(){ + for(i=0;i<acheck.length;i++){ - if(acheck[i].checked==true){ +Acheck[i].checked=false; A } at Else{ -Acheck[i].checked=true - } - - }; - }; in }; -</script>
Body
<body> courses you are interested in: <br/><input type= "button" id= "other" value= "reverse select"/><input type= "button" id= "All" Value= "Select All"/><input type= "button" id= "uncheck" value= "not selected"/><br/><div id= "box" > <input type= "checkbox" checked= "Checked"/>0. PhotoShop <br/> <input type= "checkbox" checked= "Checked"/>①. X html+css<br/> <input type= "checkbox" checked= "Checked"/>②. javascript<br/> <input type= "checkbox" checked= "Checked"/>③. Jquery <br/> <input type= "checkbox"/>④. html5+css3.0<br/> <input type= "checkbox"/>⑤. seo<br/> <input type= "checkbox"/>⑥. linux<br/> <input type= "checkbox"/>⑦. php/java<br/> <input type= "checkbox"/>⑧. Database <br/> <input type= "checkbox"/>⑨. NODE.JS<BR/></div> </body>
Select Inverse JS