求大神指点,js 做三级联下拉菜单,第三个下拉菜单没反应额
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function change(){
var provinceList=new Array();
provinceList['中国']=["浙江","江苏","福建"];
provinceList['美国']=["aa","bb"];
provinceList['英国']=["dd","ee"];
var province=document.forms[0].province;
province.options.length=0;
var index=document.forms[0].country.value;
province.options.length=0;
for(var j in provinceList[index]){
newOption=new Option(provinceList[index][j],provinceList[index][j]);
province.options.add(newOption);
}
}
function changeCity(){
alert(123);
var cityList=new Array();
cityList['浙江']=["杭州","宁波","温州","绍兴","金华","湖州","嘉兴"];
cityList['江苏']=["南京","苏州","徐州","无锡","常州","镇江"];
cityList['福建']=["福州","厦门","沙县","钓鱼岛","日本岛"];
cityList['aa']=["xx","zz","vv"];
cityList['bb']=["xx1","zz2","vv3"];
cityList['dd']=["11xx","22zz","33vv"];
cityList['ee']=["xx1122","zz2233","vv4455"];
var city=document.forms[0].city;
city.options.length=0;
var index=document.forms[0].province.value;
city.options.length=0;
for(var j in cityList[index]){
newOption=new Option(cityList[index][j],cityList[index][j]);
city.options.add(newOption);
}
}
</script>
</head>
<body>
<form action="#" method="get">
<select name="country" onchange="change()">
<option value="0" selected="selected">请选择国家</option>
<option value="中国">中国</option>
<option value="美国">美国</option>
<option value="英国">英国</option>
</select>
<select name="province">
<option value="0" selected="selected" onchange="changeCity()">请选择省份</option>
</select>
<select name="city">
<option value="0" selected="selected">请选择城市</option>
</select>
</form>
</body>
</html>