Home > Web Front-end > JS Tutorial > Native js secondary linkage

Native js secondary linkage

ringa_lee
Release: 2017-06-22 16:54:01
Original
1202 people have browsed it

<br/>
Copy after login

省市二级联动
<script> var arr = new  Array();<br>arr[0 ]="Dongcheng, Xicheng, Chongwen, Xuanwu, Chaoyang, Fengtai, Shijingshan, Haidian, Mentougou, Fangshan, Tongzhou, Shunyi, Changping, Daxing, Pinggu, Huairou, Miyun, Yanqing" arr[1 ]="Huangpu, Luwan, Xuhui, Changning, Jing'an, Putuo, Zhabei, Hongkou, Yangpu, Minhang, Baoshan, Jiading, Pudong, Jinshan, Songjiang, Qingpu, Nanhui, Fengxian, Chongming" arr[2]="Heping, Dongli, Hedong, West Qing, Hexi, Jinnan, Nankai, Beichen, Hebei, Wuqing, Hongjie, Tanggu, Hangu, Dagang, Ninghe, Jinghai, Baodi, Jixian" arr[3]="Wanzhou, Fuling, Yuzhong, Dadukou, Jiangbei, Shapingba, Jiulongpo, Nan'an, Beibei, Wansheng, Shuangjiao, Yubei, Banan, Qianjiang, Changshou, Qijiang, Tongnan, Tongliang, Dazu, Rongchang, Bishan, Liangping, Chengkou, Fengdu, Dianjiang ,Wulong, Zhongxian, Kaixian, Yunyang, Fengjie, Wushan, Wuxi, Shizhu, Xiushan, Youyang, Pengshui, Jiangjin, Hechuan, Yongchuan, Nanchuan" arr[4]="Shijiazhuang, Handan, Xingtai, Baoding , Zhangjiakou, Chengde, Langfang, Tangshan, Qinhuangdao, Cangzhou, Hengshui" arr[5]="Taiyuan, Datong, Yangquan, Changzhi, Jincheng, Shuozhou, Luliang, Xinzhou, Jinzhong, Linfen, Yuncheng" arr[6]= "Hohhot, Baotou, Wuhai, Chifeng, Hulunbuir League, Alxa League, Zhelimu League, Xing'an League, Ulanqab League, Xilingol League, Bayannur League, Yikezhao League" arr[7]="Shenyang , Dalian, Anshan, Fushun, Benxi, Dandong, Jinzhou, Yingkou, Fuxin, Liaoyang, Panjin, Tieling, Chaoyang, Huludao" arr[8]="Changchun, Jilin, Siping, Liaoyuan, Tonghua, Baishan, Songyuan, Baicheng, Yanbian" arr[9]="Harbin, Qiqihar, Mudanjiang, Jiamusi, Daqing, Suihua, Hegang, Jixi, Heihe, Shuangyashan, Yichun, Qitaihe, Daxinganling" arr[10]="Nanjing, Zhenjiang, Suzhou, Nantong, Yangzhou, Yancheng, Xuzhou, Lianyungang, Changzhou, Wuxi, Suqian, Taizhou, Huai'an" arr[11]="Hangzhou, Ningbo, Wenzhou, Jiaxing, Huzhou, Shaoxing, Jinhua, Quzhou, Zhoushan, Taizhou, Lishui" arr[ 12 ]="Hefei, Wuhu, Bengbu, Ma'anshan, Huaibei, Tongling, Anqing, Huangshan, Chuzhou, Suzhou, Chizhou, Huainan, Chaohu, Fuyang, Lu'an, Xuancheng, Bozhou" arr[13]="Fuzhou, Xiamen, Putian, Sanming, Quanzhou, Zhangzhou, Nanping, Longyan, Ningde" arr[14]="Nanchang, Jingdezhen, Jiujiang, Yingtan, Pingxiang, Xinyu, Ganzhou, Ji'an, Yichun, Fuzhou, Shangrao" arr[15]=" Jinan, Qingdao, Zibo, Zaozhuang, Dongying, Yantai, Weifang, Jining, Tai'an, Weihai, Rizhao, Laiwu, Linyi, Dezhou, Liaocheng, Binzhou, Heze" arr[16]="Zhengzhou, Kaifeng, Luoyang, Pingdingshan, Anyang, Hebi, Xinxiang, Jiaozuo, Puyang, Xuchang, Luohe, Sanmenxia, ​​Nanyang, Shangqiu, Xinyang, Zhoukou, Zhumadian, Jiyuan" arr[17]="Wuhan, Yichang, Jingzhou, Xiangfan, Huangshi, Jingmen, Huanggang, Shiyan, Enshi, Qianjiang, Tianmen, Xiantao, Suizhou, Xianning, Xiaogan, Ezhou" arr[18]="Changsha, Changde, Zhuzhou, Xiangtan, Hengyang, Yueyang, Shaoyang, Yiyang, Loudi, Huaihua, Chenzhou, Yongzhou, Xiangxi, Zhangjiajie" arr [19]="Guangzhou, Shenzhen, Zhuhai, Shantou, Dongguan, Zhongshan, Foshan, Shaoguan, Jiangmen, Zhanjiang, Maoming, Zhaoqing, Huizhou, Meizhou, Shanwei, Heyuan, Yangjiang, Qingyuan, Chaozhou, Jieyang, Yunfu" arr[20 ]="Nanning, Liuzhou, Guilin, Wuzhou, Beihai, Fangchenggang, Qinzhou, Guigang, Yulin, Nanning area, Liuzhou area, Hezhou, Baise, Hechi" arr[21]="Haikou, Sanya" arr[22]="Chengdu , Mianyang, Deyang, Zigong, Panzhihua, Guangyuan, Neijiang, Leshan, Nanchong, Yibin, Guang'an, Dachuan, Ya'an, Meishan, Garze, Liangshan, Luzhou" arr[23]="Guiyang, Liupanshui, Zunyi, Anshun, Tongren, Southwest Guizhou, Bijie, Southeast Guizhou, Southern Guizhou" arr[24]="Kunming, Dali, Qujing, Yuxi, Zhaotong, Chuxiong, Honghe, Wenshan, Simao, Xishuangbanna, Baoshan, Dehong, Lijiang, Nujiang, Diqing, Lin Cang" arr[25]="Lhasa, Shigatse, Shannan, Nyingchi, Qamdo, Ali, Nagqu" arr[26]="Xi'an, Baoji, Xianyang, Tongchuan, Weinan, Yan'an, Yulin, Hanzhong, Ankang, Shangluo" arr[ 27 ]="Lanzhou, Jiayuguan, Jinchang, Baiyin, Tianshui, Jiuquan, Zhangye, Wuwei, Dingxi, Longnan, Pingliang, Qingyang, Linxia, ​​Gannan" arr[28 ]="Yinchuan, Shizuishan, Wuzhong, Guyuan" arr[29 ]="Xining, Haidong, Hainan, Haibei, Huangnan, Yushu, Goluo, Haixi" arr[30]="Urumqi, Shihezi, Karamay, Ili, Bayingol, Changji, Kizilsu Kirgiz, Bortala, Turpan, Hami, Kashgar, Hotan, Aksu" arr[31]="Hong Kong" arr[32]="Macau" arr[33]="Taipei, Kaohsiung, Taichung, Tainan, Pingtung, Nantou, Yunlin, Hsinchu, Changhua, Miaoli, Chiayi, Hualien, Taoyuan, Yilan, Keelung, Taitung, Kinmen, Matsu, Penghu" function init()<br>{ var city = document.getElementById("city"); var cityArr = arr[0].split(","); for(var i=0;i<cityArr.length;i++)&lt;br/&gt; {&lt;br/&gt;               city[i]=new Option(cityArr[i],cityArr[ i]);&lt;br/&gt; }&lt;br/&gt;}function getCity()&lt;br/&gt;{ var pro = document.getElementById("province"); var city = document.getElementById("city"); var index = pro.selectedIndex; var cityArr = arr[index].split(","); &lt;br/&gt; &lt;br/&gt; city.length = 0; //Fill the values ​​in the city array into the city drop-down box&lt;br/&gt; for( var i=0;i<cityArr.length;i++)&lt;br/&gt; {&lt;br/&gt;           city[i]=new Option(cityArr[i],cityArr[i]);&lt;br/&gt;        }&lt;br/&gt;}</script>


The above is the detailed content of Native js secondary linkage. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template