中文(繁体)
<!-- 把電影觀看放在<body>網址 --> <!-- http://www.downcodes.com --> <!-- bbs http://www.downcodes.com/bbs- -> <SCRIPT LANGUAGE="JavaScript"> <!-- 開始var arrItems1 = new Array(); var arrItemsGrp1 = new Array(); arrItems1[3] = "卡車"; arrItemsGrp1[3] = 1; arrItems1[4] = "火車"; arrItemsGrp1[4] = 1; arrItems1[5] = "汽車"; arrItemsGrp1[5] = 1; arrItems1[6] = "船"; arrItemsGrp1[6] = 2; arrItems1[7] = "潛水艇"; arrItemsGrp1[7] = 2; arrItems1[0] = "飛機"; arrItemsGrp1[0] = 3; arrItems1[1] = "超輕"; arrItemsGrp1[1] = 3; arrItems1[2] = "滑翔機"; arrItemsGrp1[2] = 3; var arrItems2 = new Array(); var arrItemsGrp2 = new Array(); arrItems2[21] = "747"; arrItemsGrp2[21] = 0 arrItems2[22] = "塞斯納"; arrItemsGrp2[22] = 0 arrItems2[31] = "柯爾布傳單"; arrItemsGrp2[31] = 1 arrItems2[34] = "Kitfox"; arrItemsGrp2[34] = 1 arrItems2[35] = "施維策滑翔機"; arrItemsGrp2[35] = 2 arrItems2[99] = "雪佛蘭邁銳寶"; arrItemsGrp2[99] = 5 arrItems2[100] = "林肯 LS"; arrItemsGrp2[100] = 5 arrItems2[57] = "BMW Z3"; arrItemsGrp2[57] = 5 arrItems2[101] = "F-150"; arrItemsGrp2[101] = 3 arrItems2[102] = "塔霍"; arrItemsGrp2[102] = 3 arrItems2[103] = "貨運列車"; arrItemsGrp2[103] = 4 arrItems2[104] = "客運列車"; arrItemsGrp2[104] = 4 arrItems2[105] = "油輪"; arrItemsGrp2[105] = 6 arrItems2[106] = "漁船"; arrItemsGrp2[106] = 6 arrItems2[200] = "洛杉磯級"; arrItemsGrp2[200] = 7 arrItems2[201] = "基洛級"; arrItemsGrp2[201] = 7 arrItems2[203] = "海狼級"; arrItemsGrp2[203] = 7 函式 selectChange(control, controlToPopulate, ItemArray, GroupArray) { var myEle ;變數 x ; // 清空第二個下拉框中的任何選項 for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null; if (control.name == "firstChoice") { // 清空第三個下拉框的任何選項 for (var q=myChoices.thirdChoice.options.length;q>=0;q--) myChoices.thirdChoice.options [q] = 空; } // 新增預設選項 - 如果沒有值 myEle = document.createElement("option") ; myEle.value = 0 ; myEle.text = "[選擇]"; controlToPopulate.add(myEle) ; for ( x = 0 ; x < ItemArray.length ; x++ ) { if ( GroupArray[x] == control.value ) { myEle = document.createElement("option") ; myEle.value = x ; myEle.text = ItemArray[x] ; controlToPopulate.add(myEle) ; } } } // 結束 --> </script> <form name=myChoices> <tablealign="center"> <tr> <td> <SELECT id=firstChoice name=firstChoice onchange="selectChange(this, myChoices.secondaryChoice , arrItems1, arrItemsGrp1);"> <選項值=0 已選擇>[選擇]</選項> <選項值=1>陸地</選項> <選項值=2>海洋</選項> <選項值=3 >空氣</選項> </SELECT> </TD><TD> <SELECT id=secondChoice name=secondChoice onchange="selectChange(this, myChoices.thirdChoice, arrItems2, arrItemsGrp2);"> </SELECT> <SELECT id =thirdChoice 名稱=thirdChoice> </SELECT> </TD> </TR> </TABLE> </form>