二级联动省份下拉框
var provinces = ['请选择城市','湖北省','湖南省'];
var city1 = ['武汉市','荆州市','襄阳市'];
var city2 = ['长沙市','岳阳市','湘潭市'];
//生成有数据的省的下拉框
document.write("");
for(var i = 0;i
document.write(""+provinces[i]+"");
}
document.write("");
document.write("");
function showCity(obj){
var content = "";
if(obj.value==1){
for(var i = 0;i
content = content + ""+city1[i]+"";
}
}else{
for(var i = 0;i
content = content + ""+city2[i]+"";
}
}
document.getElementsByName("selCity")[0].innerHTML = content;
}