<%...@pagecontentType="text/html;charset=UTF-8"%><html><head><title>Thisisatest!</title></head><body><formname="frm"><selectname="s1"onChange="redirec(document.frm.s1.options.selectedIndex)"><optionselected>请选择</option><optionvalue="1">脚本语言</option><optionvalue="2">高级语言</option><optionvalue="3">其他语言</option></select><selectname="s2"><optionvalue="请选择"selected>请选择</option></select></form><scriptlanguage="javascript">...//获取一级菜单长度varselect1_len=document.frm.s1.options.length;varselect2=newArray(select1_len);//把一级菜单都设为数组for(i=0;i<select1_len;i++)...{select2[i]=newArray();}//定义基本选项select2[0][0]=newOption("请选择","");select2[1][0]=newOption("PHP","");select2[1][1]=newOption("ASP","");select2[1][2]=newOption("JSP","");select2[2][0]=newOption("C/C++","");select2[2][1]=newOption("Java","");select2[2][2]=newOption("C#","");select2[2][3]=newOption("hibernate","");select2[3][0]=newOption("Perl","");select2[3][1]=newOption("Ruby","");select2[3][2]=newOption("Python","");//联动函数functionredirec(x)...{vartemp=document.frm.s2;for(i=0;i<select2[x].length;i++)...{temp.options[i]=newOption(select2[x][i].text,select2[x][i].value);}temp.options[0].selected=true;}</script></body>fdsafdsf</html>