有现成的html吗?调试起来方便一些。

解决方案 »

  1.   

    问问题,如果能让回答的人方便的搭建调试环境,那么多省大家的时间?
    <html>
    <body>
    <input type="checkbox" name="C1" value="ON">
    <input type="checkbox" name="C2" value="ON">
    <input type="checkbox" name="C3" value="ON">
    <input type="checkbox" name="C4" value="ON">
    <input type="checkbox" name="C5" value="ON">
    </body>
    </html>
      

  2.   

    利用事件触发选择所有的checkbox????<html>
    <head>
    <title>采集模板生成模块</title>
    <script type="text/javascript">
     function checkAll(){
      var checkArray = document.all("box");
      for(i=0;i<checkArray[i];i++){
       checkArray[i].checked=true;
      }
     }
    </script>
    </head>
    <body>
    <center>
    <form name="ctcForm" action="" method="post">
    <table id="Table" border=2>
    <caption>
    请选择部门所管辖的指标:
    </caption>
    <tr>
     <th>&nbsp;&nbsp;</th>
     <th align="center">指标编号</th>
     <th align="center">指标名称</th>
    </tr>
    <tr>
                                             <td>
                                              <input type="checkbox" name="box">
                                             </td>
                                              <td>
                                              <input type="checkbox" name="box">
                                             </td>
                                              <td>
                                              <input type="checkbox" name="box">
                                             </td>
                                            </tr>
                                    </table>
    <br>
    <table>
    <tr>
    <select id="ctcSelect">
    <option value="atvdc">
    年度目标值数据采集模板
    </option>
    <option value="mavdc">
    每月完成值数据采集模板
    </option>
    </select>
    </tr>
    </table>
    <br>
    <table>
    <tr>
    <td>
    <input type="button" name="buildModule" value="生成"
    onClick="createModule();" />
    </td>
    <td>
    <input type="button" name="allCheck" value="全选"
    onClick="checkAll();" />
    </td>
    <td>
    <input type="reset" name="reset" value="重置" />
    </td>
    </tr>
    </table>
    </form>
    </center>
    </body>
    </html>
      

  3.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>全选的例子</title>
    [code=JScript]
    <script language="javascript">
    /*
    作者:Conis
    时间:15:33 2007/12/12
    功能:根据一个CheckBox的选择状态,将指定容器内的所有CheckBox都置为与些CheckBox相同的状态。一般用于点中一个CheckBox,全选/全取消一组CheckBox
    限制:所有的目标CheckBox必需在同一个容器中
    参数:
    oContainer:包含CheckBox的容器
    oCheckAll:全选的CheckBox,目标容器中所有CheckBox都会与这个CheckBox的Checked状态一样
    */
    function SelectAllCheckBox(oContainer, oCheckAll)
    {
    var oList = oContainer.getElementsByTagName("INPUT");
    if (oList && oList.length)
    {
    for(var i = 0; i < oList.length; i ++)
    {
    if (oList[i].type != "checkbox" || oList[i] == oCheckAll) continue;
    oList[i].checked = oCheckAll.checked;
    }
    }
    }
    </script></head><body>
    <table width="15%" border="0" cellspacing="0" cellpadding="0" id="tableOne">
      <tr>
        <td><input type="checkbox" name="checkAll" id="chkAllOne" onclick="SelectAllCheckBox(document.getElementById('tableOne'), this)"/></td>
      </tr>
      <tr>
        <td><input type="checkbox" name="checkbox2" id="checkbox2" />
        <input type="text" name="textfield" id="textfield" /></td>
      </tr>
      <tr>
        <td><input type="checkbox" name="checkbox3" id="checkbox3" /></td>
      </tr>
      <tr>
        <td><input type="checkbox" name="checkbox4" id="checkbox4" /></td>
      </tr>
      <tr>
        <td><input type="checkbox" name="checkbox5" id="checkbox5" /></td>
      </tr>
    </table>
    </body>
    </html>
    [/code]
      

  4.   

    <script language="javascript" type="text/javascript">
    function checkAll()
    {
    var checkArray = document.getElementsByName("box");
    for(i =0; i < checkArray.length;i++)
    checkArray[i].checked = true;
    }
    </script>
      

  5.   

    给你些例子
    http://blog.csdn.net/lifeng_beijing/archive/2007/12/14/1936512.aspx
      

  6.   

    真是无语:<script language="javascript" type="text/javascript">
    var bln = false;
    function checkAll(chkname)
    {
        var checkArray = document.getElementsByName(chkname);
        for(i =0; i < checkArray.length;i++)
         if (!bln)
            checkArray[i].checked = true;
         else
           checkArray[i].checked = false;    bln = !bln;
    }
    </script>
      

  7.   

    <input type=button value=全选 onclick=checkAll('checkbox1');>