<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>省市菜单</title>
<script>
var arr=[['选择市'],
["东城区","西城区","朝阳区","海淀区","丰台区","石景山区","房山区","通州区","顺义区","大兴区","昌平区","平谷区","怀柔区"],
["珠海市","汕头市","佛山市","韶关市","湛江市","肇庆市","江门市","茂名市","惠州市","梅州市","汕尾市","河源市","阳江"],
["郑州","开封","洛阳","南阳","漯河","许昌","三门峡","平顶山","周口","驻马店","新乡","鹤壁","焦作","濮阳","济源"],
["贵阳市","遵义市","安顺","六盘水","铜仁","凯里"]];
function selectedProvice(){
var provice=document.getElementById("provice");
var index=provice.selectedIndex;
var citys=arr[index];
var city=document.getElementById("city");
city.length=0;
for (var c in citys){
var test=document.createElement("option");
test.innerHTML=citys[c];
city.appendChild(test);
}
}
</script>
</head>
<body>
<select name="" id="provice" οnchange="selectedProvice()">
<option value="" >请选择省份</option>
<option value="" >北京</option>
<option value="" >广东</option>
<option value="" >河南</option>
<option value="" >贵州</option>
</select>
<select name="" id="city">
<option value="" >请选择市级</option>
</select>
</body>
</html>