function appendShi(shi) {//String splicing, splicing urban area var fjs=''; for(var i=0;i { fjs = ''; } return fjs; } $(function() { var prince = ['Fujian','Beijing','Shandong','Shanghai']; var fjs = ['Xiamen','Quanzhou','Fuzhou']; var bjs = ['Beijing',' Chaoyang District','Haidian District','Pinggu District']; var shs = ['Huangpu District','Changning District','Baoshan District','Jiading District']; var sds = [ 'Jinan','Qingdao','Yantai','Rizhao','Laiwu','sss'];
$("select[name='prin']").change(function() { var shi = $("#sel2");//Get the second select var prin = $("select[name='prin'][select option:selected]");// Get the value of the selected identity var newShiSel = $('');// if (prin.val() == 'Fujian'){ newShiSel.append(appendShi(fjs)); } if (prin.val() == 'Beijing') { newShiSel.append(appendShi(bjs)); } if (prin.val() == 'Shanghai') { newShiSel.append(appendShi(shs)); } if (prin.val() == 'Shandong') { newShiSel.append(appendShi(sds)); } shi.replaceWith(newShiSel); } ); });
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