& ltHTML & gt
& ltHEAD & gt
< title & gt new document
& lt script & gt
Var city=[[ "Beijing", "Tianjin", "Shanghai", "Chongqing"]];
Function getCity(){
var SLT province = document . getelementbyid(" province ");
var SLT city = document . getelementbyid(" city ");
var province city = city[SLT province . selectedindex- 1];
SLT city . length = 1;
for(var I = 0; I & ltprovinceCity.lengthi++){
SLT city[I+ 1]= new Option(province city[I],province city[I]);
}
}
//Here is the value of the currently selected drop-down box.
Function showInfo(){
var SLT province = document . getelementbyid(" province ");
var SLT city = document . getelementbyid(" city ");
for(var I = 0; I & ltsltCity.lengthi++){
If(sltCity.options[i]. selected)
document . getelementbyid(" city value ")。 innerHTML=sltCity.options[i]。 Value;
}
for(var I = 0; I & ltsltProvince.lengthi++){
if(sltProvince.options[i])。 Selected)
document.getElementById("pro ")。 innerHTML = SLT province . options[I]。 Value;
}
}
& lt/script & gt;
& lt/head & gt;
& ltBODY & gt
& ltform action = " some page . ASP " name = the form " & gt;
& ltselect name = " province " id = " province " onchange = " get city()" & gt;
& ltoption value = "0" selected & gt Please select your province.
& ltOption value= "municipality directly under the central government" > municipality directly under the central government
& lt/select & gt;
& ltselect id = " city " name = " city " & gt
& ltoption value="0 "> please select your city.
& lt/select & gt;
& ltinput type = " button " onclick = " showInfo();" /& gt;
& lt/form & gt;
& ltdiv id = " showvalue " & gt
Province:
& lt/div & gt;
& lt/BODY & gt;
& lt/HTML & gt;
I wrote it myself. Tested. See if it's the result you want.