JS Drop-down Box Two-level association menu Effect Code implementation

Source: Internet
Author: User
Tags dreamweaver
This article introduces the JS Drop-down box Two-level association menu Effect Code implementation, the need for friends can refer to the copy code code as follows:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

<html xmlns= "http://www.w3.org/1999/xhtml" >


<meta http-equiv= "Content-type" content= text/html;charset=gb2312 "/>"

<title> Dual Selection association menu </title>



<form name= "Doublecombo" >


<select name= "Example" size= "1" onchange= "redirect (This.options.selectedIndex)" >

<option> Special effects code </option>

<option> Web Language </option>

<option> Software Tutorials </option>


<select name= "Stage2" size= "1" >

<option value= "/texiao/shubiao" > Mouse class </option>

<option value= "/texiao/chuangkou" > Window class </option>

<option value= "/texiao/daohang" > Navigation class </option>


<input type= "button" name= "Test" value= "go!"

onclick= "Go ()" >




var groups=document.doublecombo.example.options.length

var group=new Array (groups)

for (i=0; i<groups; i++)

group[i]=new Array ()

group[0][0]=new Option ("Mouse Class", "/texiao/shubiao")

group[0][1]=new Option ("window class", "/texiao/chuangkou")

group[0][2]=new Option ("Navigation Class", "/texiao/daohang")

group[1][0]=new Option ("ASP", "/yuyan/asp")

group[1][1]=new Option ("PHP", "/yuyan/php")

Group[1][2]=new Option ("JSP", "/yuyan/jsp")

group[2][0]=new Option ("Dreamweaver", "/ruanjian/dreamweaver")

group[2][1]=new Option ("Fireworks", "/ruanjian/fireworks")

group[2][2]=new Option ("Flash", "/ruanjian/flash")

group[2][3]=new Option ("Photoshop", "/ruanjian/photoshop")

var temp=document.doublecombo.stage2

function Redirect (x) {

for (m=temp.options.length-1;m>0;m--)


for (i=0;i<group[x].length;i++) {

temp.options[i]=new Option (group[x][i].text,group[x][i].value)




function Go () {










Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.