posts - 495,  comments - 11,  trackbacks - 0

<SCRIPT LANGUAGE="JavaScript">

       var checkFlag = "false";

       function selectAll(field){

              if(checkFlag=="false"){

                     for(i=0;i<field.length;i++){

                            field[i].checked=true;

                     }

                     checkFlag = "true";

              }else{

                     for(i=0;i<field.length;i++){

                            field[i].checked=false;

                     }

                     checkFlag = "false";

              }}

</SCRIPT>

<form>

       选择爱好: <br>

       <input type="checkbox" name="inst" value="足球">足球

       <input type="checkbox" name="inst" value="篮球">篮球

       <input type="checkbox" name="inst" value="音乐">音乐

       <input type="checkbox" name="inst" value="上网">上网

       <input type="checkbox" name="inst" value="跳舞">跳舞

       <input type="checkbox" name="chkAll" value="instAll" onclick="selectAll(this.form.inst)">全选<br>

</form>
posted on 2009-07-20 22:28 jadmin 阅读(121) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: