省级城市js联动菜单代码,这个是二级js联动菜单,选择前面的省份才可以选择后面的城市,可自己修改和添加选项。
<html> <head> <meta http-equiv="content-Type" content="text/html;charset=utf-8"> <meta name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren"> <meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。"> <title>省级二级js联动菜单_武鸣人</title> <script language="javascript"> <!-- var onecount; onecount=0; subcat = new Array(); subcat[0] = new Array("徐汇区","01","001"); subcat[1] = new Array("嘉定区","01","002"); subcat[2] = new Array("黄浦区","01","003"); subcat[3] = new Array("南昌市","02","004"); subcat[4] = new Array("九江市","02","005"); subcat[5] = new Array("上饶市","02","006"); onecount=6; function changelocation(locationid) {//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) document.wuming_ren.smalllocation.length = 0; var locationid=locationid; var i; document.wuming_ren.smalllocation.options[0] = new Option('====所有地区====',''); for (i=0;i < onecount; i++) { if (subcat[i][1] == locationid) { document.wuming_ren.smalllocation.options[document.wuming_ren.smalllocation.length] = new Option(subcat[i][0], subcat[i][2]); } } }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) //--> </script> </head> <body> <a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr> <!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。--> <script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script> <script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script> <form name="wuming_ren" method="post"> <select name="www_wuming_ren" onChange="changelocation(document.wuming_ren.www_wuming_ren.options[document.wuming_ren.www_wuming_ren.selectedIndex].value)"> <option value="01" selected>上海</option> <option value="02">江西</option> </select> <select name="smalllocation"> <option selected value="">==所有地区==</option> </select> </form> <script LANGUAGE="javascript"> <!-- changelocation(document.wuming_ren.www_wuming_ren.options[document.wuming_ren.www_wuming_ren.selectedIndex].value); //--> </script> </body> </html>
本文来自武鸣人网站,转载请注明出处