熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> JSP教程 >> 正文

js下拉框二級關聯菜單效果代碼具體實現

2022-06-13   來源: JSP教程 
這篇文章介紹了js下拉框二級關聯菜單效果代碼具體實現有需要的朋友可以參考一下   復制代碼 代碼如下:
 <!DOCTYPE html PUBLIC "//WC//DTD XHTML Transitional//EN" "
<html xmlns="
<head>
<meta httpequiv="ContentType" content="text/html;charset=gb" />
<title>雙選擇關聯菜單</title>
</head>
<body>
<form name="doublecombo">
<p>
<select name="example" size="" onChange="redirect(thisoptionsselectedIndex)">
<option>特效代碼</option>
<option>網頁語言</option>
<option>軟件教程</option>
</select>
<select name="stage" size="">
<option value="/texiao/shubiao">鼠標類</option>
<option value="/texiao/chuangkou">窗口類</option>
<option value="/texiao/daohang">導航類</option>
</select>
<input type="button" name="test" value="Go!"
onClick="go()">
</p>
<script>
<!
var groups=documentdoublecomboexampleoptionslength
var group=new Array(groups)
for (I=; I<groups; I++)
group[I]=new Array()
group[][]=new Option("鼠標類""/texiao/shubiao")
group[][]=new Option("窗口類""/texiao/chuangkou")
group[][]=new Option("導航類""/texiao/daohang")
group[][]=new Option("ASP""/yuyan/asp")
group[][]=new Option("PHP""/yuyan/php")
group[][]=new Option("JSP""/yuyan/jsp")
group[][]=new Option("Dreamweaver""/ruanjian/Dreamweaver")
group[][]=new Option("Fireworks""/ruanjian/Fireworks")
group[][]=new Option("Flash""/ruanjian/Flash")
group[][]=new Option("Photoshop""/ruanjian/Photoshop")
var temp=documentdoublecombostage
function redirect(x){
for (m=tempoptionslength;m>;m)
tempoptions[m]=null
for (I=;I<group[x]length;I++){
tempoptions[I]=new Option(group[x][I]textgroup[x][I]value)
}
tempoptions[]selected=true
}
function go(){
location=tempoptions[tempselectedIndex]value
}
//>
</script>
</form>
</body>
</html></td>
 </tr>
</table>
 
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20391.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.