码迷,mamicode.com
首页 > 其他好文 > 详细

全部选中复选框

时间:2014-11-19 12:20:50      阅读:99      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   http   io   ar   color   sp   java   

 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>

 

全部选中复选框

标签:des   style   blog   http   io   ar   color   sp   java   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!