Is this what you are wanting?
Code:
<html>
<head>
<script type="text/javascript">
var countries = [ ];
countries["Egypt"] = ["Cairo","Alexandria","Sharm","Luxor"];
countries["Germany"] = ["Munchen","Dortmund","Berlin","Koln", "Nurnberg"];
countries["France"] = ["Paris", "Rouen", "Lille", "Lyon", "Marseilles"];
countries["USA"] = ["New York","Chicago","Dallas","Seattle","Los Angeles", "Atlanta", "Boston", "Miami"];
countries["Japan"] = ["Tokyo","Osaka","Kyoto","Sapporo"];
function switchCountry(selCountry) {
var citySel = selCountry.form.City;
for ( var s = citySel.options.length-1; s > 0; --s ) {
citySel.options[s] = null;
}
var chosen = selCountry.options[selCountry.selectedIndex].text;
var cList = countries[chosen];
if ( cList != null ) {
for ( var i = 0; i < cList.length; ++i ) {
citySel.options[i+1] = new Option(cList[i],cList[i]);
}
}
}
function showSelection() {
var country = document.forms[0].Country.value;
var city = document.forms[0].City.value;
if (city != "") {
alert ("You selected " + city + " in " + country);
}
}
</script>
</head>
<body>
<form>
<select name="Country" onchange="switchCountry(this);">
<option value = "">Choose Country</option>
<option value = "Egypt">Egypt</option>
<option value = "Germany">Germany</option>
<option value = "France">France</option>
<option value = "Japan">Japan</option>
<option value = "USA">USA</option>
</select>
<select name="City" onchange = "showSelection()">
<option>Choose City</option>
</select>
</form>
</body>
</html>
Quizmaster: Which Russian leader is credited as the architect of glasnost?
Contestant: Stalin