中文(繁体)
<!-- 將以下程式碼加入<body>區域中 --> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var checkflag = "false"; function check(field) { if (checkflag == "false") { for (i = 0; i < field.length; i++) { field[i].checked = true;} checkflag = "true"; } return "什麼都不選"; } else { for (i = 0; i < field.length; i++) { field[i].checked = false;檢查標誌=“假”;返回“選中全部”; } } // End --> </script> <form name=myform action="" method=post> <table> <tr><td> <b>請選擇下面的選項</b><br> < input type=checkbox name=list value="1">Java<br> <input type=checkbox name=list value="2">JavaScript<br> <input type=checkbox name=list value="3">ASP <br> <input type=checkbox name=list value="4">HTML<br> <input type=checkbox name=list value="5">SQL<br> <br> <input type=button value="選取所有" onClick="this.value=check(this.form.list)"> </td></tr> </table> </form>