<head>
<meta charset="utf-8"/>
<script type="text/javascript">
      window.onload=function(){
	       document.getElementById("unall").onclick=function(){
		          var hobbys= document.getElementsByName("hobby"); 
				  for(var i=0;i<hobbys.length;i++){
				        hobbys[i].checked=! hobbys[i].checked;
				  }
		   }
	  }	 
</script>
</head>
<body>
   全选:<input type="checkbox" />
   反选:<input type="checkbox" /><br>
   1<input  type="checkbox" name="hobby" value="1" /><br>
   2<input  type="checkbox" name="hobby" value="2"/><br>
   3<input  type="checkbox" name="hobby" value="3"/><br>
</body>  

</html>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2021-09-05
  • 2021-07-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2021-08-13
  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
相关资源
相似解决方案