jquery实现户籍地选择下拉框

利用jquery实现户籍地选择下拉框的具体代码,供大家参考,具体内容如下

data.js

var data = [{
        provname: '浙江省',
        provId: 1,
        citys: [{
            cityname: "杭州市",
            cityId: 101,
            areas: [{
                    areaname: "杭州一区",
                    areaId: 1011
                },
                {
                    areaname: "杭州二区",
                    areaId: 1012
                }
            ]
        }, {
            cityname: "温州市",
            cityId: 102,
            areas: [{
                areaname: '温州一区',
                areaId: 1021
            }, {
                areaname: '温州二区',
                areaId: 1022
            }]
        }, {
            cityname: "宁波市",
            cityId: 103,
            areas: [{
                areaname: '宁波一区',
                areaId: 1031
            }, {
                areaname: '宁波二区',
                areaId: 1032
            }]

        }, {
            cityname: "绍兴市",
            cityId: 104,
            areas: [{
                areaname: '绍兴一区',
                areaId: 1041
            }, {
                areaname: '绍兴二区',
                areaId: 1042
            }]

        }]
    }, {
        provname: '山东省',
        provId: 2,
        citys: [{
            cityname: "济南市",
            cityId: 201,
            areas: [{
                    areaname: "济南一区",
                    areaId: 2011
                },
                {
                    areaname: "济南二区",
                    areaId: 2012
                }
            ]
        }, {
            cityname: "青岛市",
            cityId: 202,
            areas: [{
                areaname: '青岛一区',
                areaId: 2021
            }, {
                areaname: '青岛二区',
                areaId: 2022
            }]
        }, {
            cityname: "济宁市",
            cityId: 203,
            areas: [{
                areaname: '济宁一区',
                areaId: 2031
            }, {
                areaname: '济宁二区',
                areaId: 2032
            }]

        }, {
            cityname: "潍坊市",
            cityId: 204,
            areas: [{
                areaname: '潍坊一区',
                areaId: 2041
            }, {
                areaname: '潍坊二区',
                areaId: 2042
            }]

        }]
    },
    {
        provname: '广东省',
        provId: 3,
        citys: [{
            cityname: "广州市",
            cityId: 301,
            areas: [{
                    areaname: "广州一区",
                    areaId: 3011
                },
                {
                    areaname: "广州二区",
                    areaId: 3012
                }
            ]
        }, {
            cityname: "潮阳市",
            cityId: 302,
            areas: [{
                areaname: '潮阳一区',
                areaId: 3021
            }, {
                areaname: '潮阳二区',
                areaId: 3022
            }]
        }, {
            cityname: "澄海市",
            cityId: 303,
            areas: [{
                areaname: '澄海一区',
                areaId: 3031
            }, {
                areaname: '澄海二区',
                areaId: 3032
            }]

        }, {
            cityname: "潮州市",
            cityId: 304,
            areas: [{
                areaname: '潮州一区',
                areaId: 3041
            }, {
                areaname: '潮州二区',
                areaId: 3042
            }]

        }]
    },
    {
        provname: '甘肃省',
        provId: 4,
        citys: [{
            cityname: "兰州市",
            cityId: 401,
            areas: [{
                    areaname: "兰州一区",
                    areaId: 4011
                },
                {
                    areaname: "兰州二区",
                    areaId: 4012
                }
            ]
        }, {
            cityname: "白银市",
            cityId: 402,
            areas: [{
                areaname: '白银一区',
                areaId: 4021
            }, {
                areaname: '白银二区',
                areaId: 4022
            }]
        }, {
            cityname: "敦煌市",
            cityId: 403,
            areas: [{
                areaname: '敦煌一区',
                areaId: 4031
            }, {
                areaname: '敦煌二区',
                areaId: 4032
            }]

        }, {
            cityname: "定西市",
            cityId: 404,
            areas: [{
                areaname: '定西一区',
                areaId: 4041
            }, {
                areaname: '定西二区',
                areaId: 4042
            }]

        }]
    }
]

demo.html




    
    
    
    Document
    
    


    
    
    
    
    
    

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

你可能感兴趣的:(jquery实现户籍地选择下拉框)