日期:2014-05-16  浏览次数:20360 次

JS中实现省份之间的动态跳转

<!DOCTYPE html>
< html>
< head>
< title>js_select.html</title>


< meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
< meta http-equiv="description" content="this is my page">
< meta http-equiv="content-type" content="text/html; charset=UTF-8">


< !--<link rel="stylesheet" type="text/css" href="./styles.css">-->


<script type="text/javascript">
window.onload = function() {
// 采用数组来存放 js原生格式,二级联动
var provinces = [ {
id : '1',
name : '北京',
city : [ '海淀区', '朝阳区', '大兴区' ]
}, {
id : '2',
name : '天津',
city : [ '北辰区', '和平区', '虹桥区' ]