刘建广

博客园 首页 联系 订阅 管理

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

 <head>  

<title> New Document </title>  

<meta name="Generator" content="EditPlus">  

<meta name="Author" content="">  

<meta name="Keywords" content="">  

<meta name="Description" content="">  

<script>     

function  selectAll(){         

for ( var  i = 0 ; i <document.getElementById("td1").childNodes.length; i ++ ){             

var  obj  =  document.getElementById("td1").childNodes[i];             

if (obj  &&  obj.type  &&  obj.type  ==   "checkbox" )

obj.disabled  = true   ;        

}    

}

</script>  

</head>

 <body>  

<table  border =1  cellpadding =0  cellspacing =0  width =300>     

<tr>         

<td  id ="td1">             

<input  type ="button"  value = click  onclick ="selectAll()"><br>             

<input  type ="checkbox"> 1 <br>             

<input  type ="checkbox"> 2 <br>             

<input  type ="checkbox"> 3 <br>             

<input  type ="checkbox"> 4 <br>             

<input  type ="checkbox"> 5 <br>             

<input  type ="checkbox"> 6 <br>             

<input  type ="checkbox"> 7 <br>         

</ td>     

</ tr>     

<tr>         

<td  id =td2>             

<input  type ="checkbox"> 11 <br>             

<input  type ="checkbox"> 12 <br>         

</ td>     

</ tr>

</ table>  

</body>

</html>

posted on 2012-06-11 14:40  刘建广  阅读(4309)  评论(0编辑  收藏  举报