首页 > 其他 > 详细

全部选中复选框

时间:2014-11-19 12:17:33      阅读:294      评论:0      收藏:0      [点我收藏+]
 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2 <html xmlns="http://www.w3.org/1999/xhtml">
 3  <head>
 4   <title> new document </title>
 5   <meta name="generator" content="editplus" />
 6   <meta name="author" content="" />
 7   <meta name="keywords" content="" />
 8   <meta name="description" content="" />
 9   <script type="text/javascript">
10   function test(sta){
11     var chk = document.getElementsByTagName(input);
12     for (var i=0;i<7 ;i++ ){
13         chk[i].checked= sta;
14 
15     }
16   }
17   </script>
18  </head>
19 
20  <body>
21  <input type="checkbox" value="" /><br/>
22  <input type="checkbox" value="" /><br/>
23  <input type="checkbox" value="" /><br/>
24  <input type="checkbox" value="" /><br/>
25  <input type="checkbox" value="" /><br/>
26  <input type="checkbox" value="" /><br/>
27  <input type="checkbox" value="" /><br/>
28 
29   <input type="button" value="全选"onclick="test(‘checked‘);">
30    <input type="button" value="全不选"onclick="test(‘‘);">
31  </body>
32 </html>

 

全部选中复选框

原文:http://www.cnblogs.com/a2762/p/4107705.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!