省市二级联动
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<form name="form1" method="post" action="">
省份:<select name="province" id="province"></select>
地区:<select name="city" id="city"></select>
</form>
<script src="js/jquery-1.7.1.js"></script>
<script>
var arr_province = ["请选择省/城市","北京市","上海市","天津市","重庆市","深圳市","广东省"];
var arr_city = [
["请选择城市/地区"],
["东城区","西城区","朝阳区","宣武区","昌平区","大兴区","丰台区","海淀区"],
['宝山区','长宁区','丰贤区', '虹口区','黄浦区','青浦区','南汇区','徐汇区','卢湾区'],
['和平区', '河西区', '南开区', '河北区', '河东区', '红桥区', '塘古区', '开发区'],
['俞中区', '南岸区', '江北区', '沙坪坝区', '九龙坡区', '渝北区', '大渡口区', '北碚区'],
['福田区', '罗湖区', '盐田区', '宝安区', '龙岗区', '南山区', '深圳周边'],
['广州市','惠州市','汕头市','珠海市','佛山市','中山市','东莞市']
];
var $pro = $('#province');
var $city = $('#city');
for(var i = 0; i < arr_province.length; i++) {
$('<option>' + arr_province[i] + '</option>').appendTo($pro);
}
$pro.change(function() {
var index = $pro.find($("option:selected")).index();
$city.html('');
for(var k = 0; k < arr_city[index].length; k++) {
$('<option>' + arr_city[index][k] + '</option>').appendTo($city);
}
});
</script>
</body>
</html>