<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">functionSetatt () {varImgobj=document.getelementbyid ("Getimg"); Imgobj.setattribute ("Width", 200); Imgobj.setattribute ("src", "images/2.jpg"); } functionGetatt () {varImgobj=document.getelementbyid ("Getimg"); Alert (Imgobj.getattribute ("SRC")); } functionRemoveatt () {varImgobj=document.getelementbyid ("Getimg"); Imgobj.removeattribute ("Width"); } </script><! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">window.onload=function(){ varQx_obj=document.getelementbyid ("Qxobj"); varQuxiao_obj=document.getelementbyid ("Quxiaoobj"); varFx_obj=document.getelementbyid ("Fxobj"); varAh_obj=document.getelementsbyname ("Suju"); //Select All buttonqx_obj.onclick=function(){ for(vari=0;i<ah_obj.length;i++) {ah_obj[i].checked=true; } } //Cancel Buttonquxiao_obj.onclick=function(){ for(vari=0;i<ah_obj.length;i++) {ah_obj[i].checked=false; } } //Inverse Selection Codefx_obj.onclick=function(){ for(vari=0;i<ah_obj.length;i++){ if(ah_obj[i].checked==true) {ah_obj[i].checked=false; }Else{ah_obj[i].checked=true; } } } } </script>Hobby 1:<input type= "checkbox" Name= "Suju"/></br>Hobby 2:<input type= "checkbox" Name= "Suju"/></br>Hobby 3:<input type= "checkbox" Name= "Suju"/></br>Hobby 4:<input type= "checkbox" Name= "Suju"/></br>Hobby 5:<input type= "checkbox" Name= "Suju"/></br>Hobby 6:<input type= "checkbox" Name= "Suju"/></br>Hobby 7:<input type= "checkbox" Name= "Suju"/></br>Hobby 8:<input type= "checkbox" Name= "Suju"/></br><input type= "button" value= "Select All" id= "Qxobj"/><input Type= "button" value= "Cancel" id= "Quxiaoobj"/><input type= "button" value= "reverse select" id= "Fxobj"/></body></ Html>
The code is playing today.