可以定义一个<input type=hidden>
放到这个,这样这个页面就可以无限次使用了,并且还可以传到下个页面
和static变量稍微差不多了,就是关了就没了。

解决方案 »

  1.   

    <b>是不是要这样的功能?</b>
    <script language="JavaScript">
    <!--
    function chkClk(obj){
    var chks=document.getElementsByName(obj.name);
    //alert(chks.length);
    if(obj.flag=="main"){
    for(var i=1;i<chks.length;i++)
    chks[i].checked=obj.checked;
    }
    }
    //-->
    </script><input type="checkbox" onclick="chkClk(this)" name="type1" flag="main">typetext
    <li><input type="checkbox" onclick="chkClk(this)" name="type1">typetext</li>
    <li><input type="checkbox" onclick="chkClk(this)" name="type1">typetext</li>
    <li><input type="checkbox" onclick="chkClk(this)" name="type1">typetext</li>
    <li><input type="checkbox" onclick="chkClk(this)" name="type1">typetext</li>
    <li><input type="checkbox" onclick="chkClk(this)" name="type1">typetext</li>
    <li><input type="checkbox" onclick="chkClk(this)" name="type1">typetext</li>
    <br><br>
    <input type="checkbox" onclick="chkClk(this)" name="type2" flag="main">typetext
    <li><input type="checkbox" onclick="chkClk(this)" name="type2">typetext</li>
    <li><input type="checkbox" onclick="chkClk(this)" name="type2">typetext</li>
    <li><input type="checkbox" onclick="chkClk(this)" name="type2">typetext</li>
    <li><input type="checkbox" onclick="chkClk(this)" name="type2">typetext</li>
    <li><input type="checkbox" onclick="chkClk(this)" name="type2">typetext</li>
    <li><input type="checkbox" onclick="chkClk(this)" name="type2">typetext</li>