1 <SCRIPT LANGUAGE="JavaScript">
           2 
           3 var checkflag = false;
           4     function check(field) 
           5     {
           6 
           7         
           8         if (checkflag == false
           9         {
          10     
          11         if(field.length==null)
          12         {
          13     
          14             field.checked=true;
          15             checkflag =true;
          16             //return false;
          17     
          18         }
          19 
          20             for (i = 0; i < field.length; i++
          21             {
          22                 
          23                 field[i].checked = true;
          24             }
          25             checkflag = true;
          26             //return "false"; 
          27         }else 
          28         {
          29 
          30         if(field.length==null)
          31         {
          32     
          33             field.checked=false;
          34             checkflag =false;
          35             //return true;
          36     
          37         }
          38             for (i = 0; i < field.length; i++
          39             {
          40                 field[i].checked = false
          41             }
          42             checkflag = false;
          43             //return true; 
          44         }
          45     }
          46 </script>
          47 
          48 <html>
          49 <head>
          50 <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
          51 <title>無標(biāo)題文檔</title>
          52 </head>
          53 
          54 <body>
          55 <form name="form1" method="post" action="">
          56   <p>
          57     <input type="checkbox" name="ckbox" value="checkbox"> 
          58     dfg  </p>
          59   <p>
          60   <input type="checkbox" name="ckbox" value="checkbox"> 
          61     dfg  
          62 </p>
          63   <p><br>
          64   <input type="checkbox" name="全選" onClick="this.value=check(this.form.ckbox)">    
          65        全選</p>
          66   <p>&nbsp;  </p>
          67 </form>
          68 </body>
          69 </html>
          70 


          posted on 2007-02-07 09:52 -274°C 閱讀(495) 評論(0)  編輯  收藏 所屬分類: web前端

          常用鏈接

          留言簿(21)

          隨筆分類(265)

          隨筆檔案(242)

          相冊

          JAVA網(wǎng)站

          關(guān)注的Blog

          搜索

          •  

          積分與排名

          • 積分 - 914107
          • 排名 - 40

          最新評論

          主站蜘蛛池模板: 拉萨市| 河北区| 宁乡县| 蓬溪县| 宜阳县| 屏边| 岳西县| 临洮县| 方山县| 泸州市| 青铜峡市| 五常市| 昭觉县| 乌鲁木齐县| 化州市| 同仁县| 察雅县| 龙陵县| 托里县| 江川县| 会东县| 鹤峰县| 额尔古纳市| 新昌县| 密云县| 城固县| 祁阳县| 威宁| 水城县| 常山县| 开阳县| 衢州市| 万山特区| 巴彦淖尔市| 平陆县| 余干县| 四会市| 青川县| 华阴市| 乌苏市| 万载县|