posts - 495,  comments - 11,  trackbacks - 0

<SCRIPT LANGUAGE="JavaScript">

       function selectInst(){

              var checkbox = document.getElementsByName("inst");

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

                     if(checkbox[i].checked){

                            var temp = checkbox[i].value;

                            alert(temp);

                     }

              }

       }

</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="button" value="提交" onclick="selectInst()">

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

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


网站导航: