![](https://i-blog.csdnimg.cn/blog_migrate/ca46cca76979aacb4f0017a08e444503.gif)
<select id="sel1" onchange="selectProv()">
<option value="">请选择省份</option>
<option value="0">北京市</option>
<option value="1">山东省</option>
</select>
<select id="sel2">
<option value="">请选择市/区</option>
</select>
var arrs = [];
arrs[0] = ["海淀区","昌平区","朝阳区","通州区","大兴区"];
arrs[1] = ["济南","青岛","日照","威海","潍坊","东营"];
function selectProv(){
var provinceIndex = document.getElementById('sel1').value;
var str = "<option value=''>请选择市/区</option>";
if(provinceIndex!=""){
var cities = arrs[provinceIndex];
for(var i = 0; i < cities.length; i++)
str += "<option value=''>"+ cities[i] +"</option>";
}
document.getElementById("sel2").innerHTML = str;
}