省份城市级联

主要代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!-- include javascript -->
<script src="assets/js/f.g.js" type="text/javascript"></script>
<script src="assets/js/province_city.js" type="text/javascript"></script>
<!-- html -->
<select id="province" name="province" onchange="PROVINCE_CITY.select_change(this.value, 'city')">
<option value="0">请选择</option>
</select>
<select id="city" name="city" onchange="PROVINCE_CITY.select_change(this.value, 'area')">
<option value="0">请选择</option>
</select>
<select id="area" name="area">
<option value="0">请选择</option>
</select>
<!-- javascript -->
<script type="text/javascript">
/**初始化省份 start**/
for(var i in PROVINCE_CITY.area[0]){
var _province_option = document.createElement("option");
_province_option.value = i;
_province_option.innerHTML = PROVINCE_CITY.area[0][i];
FUN_G.get_id('province').appendChild(_province_option);
}
/**初始化省份 end**/
</script>