资源描述:
《js实现省市级联代码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、js的写法:place.js//province(省份类)functionprovinceList(){ this.length=36; this[0]=newOption("不限","不限"); this[1]=newOption("北京","北京"); this[2]=newOption("重庆","重庆"); this[3]=newOption("福建","福建"); this[4]=newOption("甘肃","甘肃"); this[5]=newOption("广东","广东"); this[6]=newO
2、ption("广西","广西"); this[7]=newOption("贵州","贵州"); this[8]=newOption("海南","海南"); this[9]=newOption("河北","河北"); this[10]=newOption("河南","河南"); this[11]=newOption("黑龙江","黑龙江"); this[12]=newOption("湖北","湖北"); this[13]=newOption("湖南","湖南"); this[14]=newOption("江苏","江苏
3、"); this[15]=newOption("江西","江西"); this[16]=newOption("吉林","吉林"); this[17]=newOption("辽宁","辽宁"); this[18]=newOption("内蒙古","内蒙古"); this[19]=newOption("宁夏","宁夏"); this[20]=newOption("青海","青海"); this[21]=newOption("上海","上海"); this[22]=newOption("山东","山东"); this[
4、23]=newOption("山西","山西"); this[24]=newOption("陕西","陕西"); this[25]=newOption("四川","四川"); this[26]=newOption("天津","天津"); this[27]=newOption("新疆","新疆"); this[28]=newOption("西藏","西藏"); this[29]=newOption("云南","云南"); this[30]=newOption("浙江","浙江"); this[31]=newOption
5、("安徽","安徽"); this[32]=newOption("香港","香港"); this[33]=newOption("澳门","澳门"); this[34]=newOption("台湾","台湾"); this[35]=newOption("其它","其他"); returnthis;}//city(城市类)functioncitylist(){ this.length=36; this[0]=newArray(1); this[0][0]=newOption("不限","不限"); this[1]=newArra
6、y(1); this[1][0]=newOption("北京市","北京市"); this[2]=newArray(4); this[2][0]=newOption("重庆市","重庆市"); this[2][1]=newOption("涪陵市","涪陵市"); this[2][2]=newOption("黔江市","黔江市"); this[2][3]=newOption("万县市","万县市"); this[3]=newArray(9); this[3][0]=newOption("福州市","福州市"); t
7、his[3][1]=newOption("龙岩市","龙岩市"); this[3][2]=newOption("南平市","南平市"); this[3][3]=newOption("宁德市","宁德市"); this[3][4]=newOption("莆田市","莆田市"); this[3][5]=newOption("泉州市","泉州市"); this[3][6]=newOption("三明市","三明市"); this[3][7]=newOption("厦门市","厦门市"); this[3][8]=newOptio
8、n("漳州市","漳州市"); this[4]=newArray(14); this[4][0]=newOptio