成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

javascript級聯(lián),級聯(lián)的連接方式

javascript 級聯(lián)菜單,ie6可以用,ie8不支持,有什么方法可以兼容?

document.cascadeForm這種獲取form的寫法,只有古老的ie里面才支持,請使用標(biāo)準(zhǔn)的寫法

成都創(chuàng)新互聯(lián)公司專注于海陵網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗。 熱誠為您提供海陵營銷型網(wǎng)站建設(shè),海陵網(wǎng)站制作、海陵網(wǎng)頁設(shè)計、海陵網(wǎng)站官網(wǎng)定制、重慶小程序開發(fā)服務(wù),打造海陵網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供海陵網(wǎng)站排名全網(wǎng)營銷落地服務(wù)。

document.forms['cascadeForm']

另外,select的聯(lián)動事件不應(yīng)該綁定在onclick上,應(yīng)該綁定在onchange上吧?

Javascript級聯(lián)下拉菜單代碼?

這里有一個js的多級聯(lián)動下拉菜單

可以自定義位置和樣式 比較實(shí)用

里面有教程和源碼

JavaScript實(shí)現(xiàn)省市縣級聯(lián)

寫的似乎有點(diǎn)麻煩,不如直接在下拉列表的Option里添加。

我簡單給你寫個。

script language="javascript"

var arr=new Array();

arr["廣州01"]=["東城區(qū)","東城區(qū)","越秀區(qū)"];

arr["廣州02"]=["蘿崗區(qū)","天河區(qū)","南沙區(qū)"];

arr["廣州03"]=["越秀區(qū)","鹽田區(qū)","龍崗區(qū)"];

function Test()

{

var province=document.getElementById("province").value;

var district=document.getElementById("district");

//清空

district.length=1;

for(var i=0;iarr[province].length;i++)

{

var opt=new Option(arr[province][i],arr[province][i]);

district.options.add(opt);

}

}

/script

body

select id="province" onchange="Test()"

option--請選擇--/option

option value="廣州01"廣州01/option

option value="廣州02"廣州02/option

option value="廣州03"廣州03/option

/select

select id="district"option--請選擇--/option/select

/body

怎么實(shí)現(xiàn)級聯(lián)菜單?

對于一個多條件的查詢,我們希望在選擇了一個菜單項后,另外一個下拉菜單能夠根據(jù)我們所選擇的第一個菜單項顯示其所有子菜單項。這就是本文提到的級聯(lián)菜單問題。級聯(lián)菜單實(shí)現(xiàn)的方法有很多,本文根據(jù)筆者所做的一個小實(shí)驗,簡單的介紹一下如何通過XML來實(shí)現(xiàn)級聯(lián)菜單的功能。

首先要定義一個XML文件,用以存放級聯(lián)菜單的信息,我們命名為query.xml,其代碼如下:

?xml version="1.0" encoding="gb2312"?

info

course

text軟件工程/text

value1/value

/course

course

text數(shù)據(jù)結(jié)構(gòu)/text

value2/value

/course

course

text操作系統(tǒng)/text

value3/value

/course

course

text計算機(jī)組成原理/text

value4/value

/course

teacher

text張老師/text

value1/value

/teacher

teacher

text李老師/text

value2/value

/teacher

teacher

text劉老師/text

value3/value

/teacher

teacher

text王老師/text

value4/value

/teacher

class

text一班/text

value1/value

/class

class

text二班/text

value2/value

/class

class

text三班/text

value3/value

/class

class

text四班/text

value4/value

/class

/info

然后再創(chuàng)建一個HTML文件,命名為query.html

在query.html里,首先創(chuàng)建一個表單

form id="queryForm"

select id="keyword" name="keyword" onChange="showDetail()"

option value="default"default/option

option value="1"課程/option

option value="2"教師/option

option value="3"班級/option

/select

select id="content" name="content" onChange="showValue()"

option value="default"default/option

/select

/form

從上面的代碼可以看出,當(dāng)我們選擇第一級菜單時,會觸發(fā)showDetail方法,這是通過JavaScript來實(shí)現(xiàn)的,因此我們還需要定義一個showDetail方法,其實(shí)現(xiàn)代碼如下:

function showDetail(){

var document_xml = new ActiveXObject("Microsoft.XMLDOM");

document_xml.load("query.xml"); //加載info.xml

var RootNode = document_xml.documentElement; //獲得info.xml文檔的根節(jié)點(diǎn)

var keyword = document.getElementByIdx("keyword").value;

var details; //用以存放二級菜單內(nèi)容,是一個數(shù)組對象

var content = document.getElementByIdx("content");

content.options.length = 0;//先清空

if(keyword=="default"){

var option = new Option("default","default");

content.add(option);

}else{

if(keyword=="1"){

details = document_xml.getElementsByTagName_r("course");

}else if(keyword=="2"){

details = document_xml.getElementsByTagName_r("teacher");

}else if(keyword=="3"){

details = document_xml.getElementsByTagName_r("class");

}

for(var i=0;idetails.length;i++){

var xText = details[i].childNodes[0].firstChild.nodeValue; //獲取文本

var xValue = details[i].childNodes[1].firstChild.nodeValue; //獲取文本以應(yīng)的值

var option = new Option(xText,xValue);

content.add(option);

}

}

}

從上面的代碼可以看出,showDetail方法會根據(jù)一級菜單選項的不同顯示對應(yīng)的子菜單。這里涉及到通過JavaScript來讀取xml文件的操作,可以參見源碼的注釋部分,記得結(jié)合xml文件里的內(nèi)容一起看哦。

二級菜單顯示出來之后,我們就可以進(jìn)行選擇了,選擇之后,會調(diào)用showValue方法,把選到的子菜單項的value和text顯示出來。showValue的定義如下:

function showValue(){

var content= document.getElementByIdx("content");

var contentText = content.options[content.selectedIndex].text; //獲取text值

var contentValue = document.getElementByIdx("content").value; //獲取文本

alert(contentValue+" "+contentText);

}

在這個方法里,要注意option當(dāng)中text值的獲取,它與select表單域的value的獲取方式不大一樣,詳見代碼及其注釋。

把兩個方法封裝在head/head之間,記得要寫上script language="javascript"和/script了,然后你直接打開query.xml就可以看到效果了。

不知是否對樓主有用,希望對樓主有所幫助。

省份與城市的二級級聯(lián) 用javascript實(shí)現(xiàn)

給你一個三級聯(lián)動,09年最新版的

!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""

html xmlns=""

head

meta http-equiv="Content-Type" content="text/html; charset=utf-8" /

title無標(biāo)題文檔/title

/head

body

select id="province" onchange="setCity(this.value);getArea()" name="province"

option value="" selected="selected"請選擇/option

/select

select id="city" onchange="setCounty(this.value);getArea()" name="city" style="display:;"

option value="" selected="selected"請選擇/option

/select

select id="county" name="county" onchange="getArea()" style="display:;"

option value="" selected="selected"請選擇/option

/select

input type="text" name="area" id="area" value="222426" onchange="setArea();"/

input type="button" value="轉(zhuǎn)" onclick="setArea();" /

script type="text/javascript"

var areaData = "110000|北京市,110100|市轄區(qū),110101|東城區(qū),110102|西城區(qū),110103|崇文區(qū),110104|宣武區(qū),110105|朝陽區(qū),110106|豐臺區(qū),110107|石景山區(qū),110108|海淀區(qū),110109|門頭溝區(qū),110111|房山區(qū),110112|通州區(qū),110113|順義區(qū),110114|昌平區(qū),110115|大興區(qū),110116|懷柔區(qū),110117|平谷區(qū),110200|縣,110228|密云縣,110229|延慶縣,120000|天津市,120100|市轄區(qū),120101|和平區(qū),120102|河?xùn)|區(qū),120103|河西區(qū),120104|南開區(qū),120105|河北區(qū),120106|紅橋區(qū),120107|塘沽區(qū),120108|漢沽區(qū),120109|大港區(qū),120110|東麗區(qū),120111|西青區(qū),120112|津南區(qū),120113|北辰區(qū),120114|武清區(qū),120115|寶坻區(qū),120200|縣,120221|寧河縣,120223|靜??h,120225|薊縣,130000|河北省,130100|石家莊市,130101|市轄區(qū),130102|長安區(qū),130103|橋東區(qū),130104|橋西區(qū),130105|新華區(qū),130107|井陘礦區(qū),130108|裕華區(qū),130121|井陘縣,130123|正定縣,130124|欒城縣,130125|行唐縣,130126|靈壽縣,130127|高邑縣,130128|深澤縣,130129|贊皇縣,130130|無極縣,130131|平山縣,130132|元氏縣,130133|趙縣,130181|辛集市,130182|藁城市,130183|晉州市,130184|新樂市,130185|鹿泉市,130200|唐山市,130201|市轄區(qū),130202|路南區(qū),130203|路北區(qū),130204|古冶區(qū),130205|開平區(qū),130207|豐南區(qū),130208|豐潤區(qū),130223|灤縣,130224|灤南縣,130225|樂亭縣,130227|遷西縣,130229|玉田縣,130230|唐??h,130281|遵化市,130283|遷安市,130300|秦皇島市,130301|市轄區(qū),130302|海港區(qū),130303|山海關(guān)區(qū),130304|北戴河區(qū),130321|青龍滿族自治縣,130322|昌黎縣,130323|撫寧縣,130324|盧龍縣,130400|邯鄲市,130401|市轄區(qū),130402|邯山區(qū),130403|叢臺區(qū),130404|復(fù)興區(qū),130406|峰峰礦區(qū),130421|邯鄲縣,130423|臨漳縣,130424|成安縣,130425|大名縣,130426|涉縣,130427|磁縣,130428|肥鄉(xiāng)縣,130429|永年縣,130430|邱縣,130431|雞澤縣,130432|廣平縣,130433|館陶縣,130434|魏縣,130435|曲周縣,130481|武安市,130500|邢臺市,130501|市轄區(qū),130502|橋東區(qū),130503|橋西區(qū),130521|邢臺縣,130522|臨城縣,130523|內(nèi)丘縣,130524|柏鄉(xiāng)縣,130525|隆堯縣,130526|任縣,130527|南和縣,130528|寧晉縣,130529|巨鹿縣,130530|新河縣,130531|廣宗縣,130532|平鄉(xiāng)縣,130533|威縣,130534|清河縣,130535|臨西縣,130581|南宮市,130582|沙河市,130600|保定市,130601|市轄區(qū),130602|新市區(qū),130603|北市區(qū),130604|南市區(qū),130621|滿城縣,130622|清苑縣,130623|淶水縣,130624|阜平縣,130625|徐水縣,130626|定興縣,130627|唐縣,130628|高陽縣,130629|容城縣,130630|淶源縣,130631|望都縣,130632|安新縣,130633|易縣,130634|曲陽縣,130635|蠡縣,130636|順平縣,130637|博野縣,130638|雄縣,130681|涿州市,130682|定州市,130683|安國市,130684|高碑店市,130700|張家口市,130701|市轄區(qū),130702|橋東區(qū),130703|橋西區(qū),130705|宣化區(qū),130706|下花園區(qū),130721|宣化縣,130722|張北縣,130723|康??h,130724|沽源縣,130725|尚義縣,130726|蔚縣,130727|陽原縣,130728|懷安縣,130729|萬全縣,130730|懷來縣,130731|涿鹿縣,130732|赤城縣,130733|崇禮縣,130800|承德市,130801|市轄區(qū),130802|雙橋區(qū),130803|雙灤區(qū),130804|鷹手營子礦區(qū),130821|承德縣,130822|興隆縣,130823|平泉縣,130824|灤平縣,130825|隆化縣,130826|豐寧滿族自治縣,130827|寬城滿族自治縣,130828|圍場滿族蒙古族自治縣,130900|滄州市,130901|市轄區(qū),130902|新華區(qū),130903|運(yùn)河區(qū),130921|滄縣,130922|青縣,130923|東光縣,130924|海興縣,130925|鹽山縣,130926|肅寧縣,130927|南皮縣,130928|吳橋縣,130929|獻(xiàn)縣,130930|孟村回族自治縣,130981|泊頭市,130982|任丘市,130983|黃驊市,130984|河間市,131000|廊坊市,131001|市轄區(qū),131002|安次區(qū),131003|廣陽區(qū),131022|固安縣,131023|永清縣,131024|香河縣,131025|大城縣,131026|文安縣,131028|大廠回族自治縣,131081|霸州市,131082|三河市,131100|衡水市,131101|市轄區(qū),131102|桃城區(qū),131121|棗強(qiáng)縣,131122|武邑縣,131123|武強(qiáng)縣,131124|饒陽縣,131125|安平縣,131126|故城縣,131127|景縣,131128|阜城縣,131181|冀州市,131182|深州市,140000|山西省,140100|太原市,140101|市轄區(qū),140105|小店區(qū),140106|迎澤區(qū),140107|杏花嶺區(qū),140108|尖草坪區(qū),140109|萬柏林區(qū),140110|晉源區(qū),140121|清徐縣,140122|陽曲縣,140123|婁煩縣,140181|古交市,140200|大同市,140201|市轄區(qū),140202|城區(qū),140203|礦區(qū),140211|南郊區(qū),140212|新榮區(qū),140221|陽高縣,140222|天鎮(zhèn)縣,140223|廣靈縣,140224|靈丘縣,140225|渾源縣,140226|左云縣,140227|大同縣,140300|陽泉市,140301|市轄區(qū),140302|城區(qū),140303|礦區(qū),140311|郊區(qū),140321|平定縣,140322|盂縣,140400|長治市,140401|市轄區(qū),140402|城區(qū),140411|郊區(qū),140421|長治縣,140423|襄垣縣,140424|屯留縣,140425|平順縣,140426|黎城縣,140427|壺關(guān)縣,140428|長子縣,140429|武鄉(xiāng)縣,140430|沁縣,140431|沁源縣,140481|潞城市,140500|晉城市,140501|市轄區(qū),140502|城區(qū),140521|沁水縣,140522|陽城縣,140524|陵川縣,140525|澤州縣,140581|高平市,140600|朔州市,140601|市轄區(qū),140602|朔城區(qū),140603|平魯區(qū),140621|山陰縣,140622|應(yīng)縣,140623|右玉縣,140624|懷仁縣,140700|晉中市,140701|市轄區(qū),140702|榆次區(qū),140721|榆社縣,140722|左權(quán)縣,140723|和順縣,140724|昔陽縣,140725|壽陽縣,140726|太谷縣,140727|祁縣,140728|平遙縣,140729|靈石縣,140781|介休市,140800|運(yùn)城市,140801|市轄區(qū),140802|鹽湖區(qū),140821|臨猗縣,140822|萬榮縣,140823|聞喜縣,140824|稷山縣,140825|新絳縣,140826|絳縣,140827|垣曲縣,140828|夏縣,140829|平陸縣,140830|芮城縣,140881|永濟(jì)市,140882|河津市,140900|忻州市,140901|市轄區(qū),140902|忻府區(qū),140921|定襄縣,140922|五臺縣,140923|代縣,140924|繁峙縣,140925|寧武縣,140926|靜樂縣,140927|神池縣,140928|五寨縣,140929|岢嵐縣,140930|河曲縣,140931|保德縣,140932|偏關(guān)縣,140981|原平市,141000|臨汾市,141001|市轄區(qū),141002|堯都區(qū),141021|曲沃縣,141022|翼城縣,141023|襄汾縣,141024|洪洞縣,141025|古縣,141026|安澤縣,141027|浮山縣,141028|吉縣,141029|鄉(xiāng)寧縣,141030|大寧縣,141031|隰縣,141032|永和縣,141033|蒲縣,141034|汾西縣,141081|侯馬市,141082|霍州市,141100|呂梁市,141101|市轄區(qū),141102|離石區(qū),141121|文水縣,141122|交城縣,141123|興縣,141124|臨縣,141125|柳林縣,141126|石樓縣,141127|嵐縣,141128|方山縣,141129|中陽縣,141130|交口縣,141181|孝義市,141182|汾陽市,150000|內(nèi)蒙古自治區(qū),150100|呼和浩特市,150101|市轄區(qū),150102|新城區(qū),150103|回民區(qū),150104|玉泉區(qū),150105|賽罕區(qū),150121|土默特左旗,150122|托克托縣,150123|和林格爾縣,150124|清水河縣,150125|武川縣,150200|包頭市,150201|市轄區(qū),150202|東河區(qū),150203|昆都侖區(qū),150204|青山區(qū),150205|石拐區(qū),150206|白云礦區(qū),150207|九原區(qū),150221|土默特右旗,150222|固陽縣,150223|達(dá)爾罕茂明安聯(lián)合旗,150300|烏海市,150301|市轄區(qū),150302|海勃灣區(qū),150303|海南區(qū),150304|烏達(dá)區(qū),150400|赤峰市,150401|市轄區(qū),150402|紅山區(qū),150403|元寶山區(qū),150404|松山區(qū),150421|阿魯科爾沁旗,150422|巴林左旗,150423|巴林右旗,150424|林西縣,150425|克什克騰旗,150426|翁牛特旗,150428|喀喇沁旗,150429|寧城縣,150430|敖漢旗,150500|通遼市,150501|市轄區(qū),150502|科爾沁區(qū),150521|科爾沁左翼中旗,150522|科爾沁左翼后旗,150523|開魯縣,150524|庫倫旗,150525|奈曼旗,150526|扎魯特旗,150581|霍林郭勒市,150600|鄂爾多斯市,150601|市轄區(qū),150602|東勝區(qū),150621|達(dá)拉特旗,150622|準(zhǔn)格爾旗,150623|鄂托克前旗,150624|鄂托克旗,150625|杭錦旗,150626|烏審旗,150627|伊金霍洛旗,150700|呼倫貝爾市,150701|市轄區(qū),150702|海拉爾區(qū),150721|阿榮旗,150722|莫力達(dá)瓦達(dá)斡爾族自治旗,150723|鄂倫春自治旗,150724|鄂溫克族自治旗,150725|陳巴爾虎旗,150726|新巴爾虎左旗,150727|新巴爾虎右旗,150781|滿洲里市,150782|牙克石市,150783|扎蘭屯市,150784|額爾古納市,150785|根河市,150800|巴彥淖爾市,150801|市轄區(qū),150802|臨河區(qū),150821|五原縣,150822|磴口縣,150823|烏拉特前旗,150824|烏拉特中旗,150825|烏拉特后旗,150826|杭錦后旗,150900|烏蘭察布市,150901|市轄區(qū),150902|集寧區(qū),150921|卓資縣,150922|化德縣,150923|商都縣,150924|興和縣,150925|涼城縣,150926|察哈爾右翼前旗,150927|察哈爾右翼中旗,150928|察哈爾右翼后旗,150929|四子王旗,150981|豐鎮(zhèn)市,152200|興安盟,152201|烏蘭浩特市,152202|阿爾山市,152221|科爾沁右翼前旗,152222|科爾沁右翼中旗,152223|扎賚特旗,152224|突泉縣,152500|錫林郭勒盟,152501|二連浩特市,152502|錫林浩特市,152522|阿巴嘎旗,152523|蘇尼特左旗,152524|蘇尼特右旗,152525|東烏珠穆沁旗,152526|西烏珠穆沁旗,152527|太仆寺旗,152528|鑲黃旗,152529|正鑲白旗,152530|正藍(lán)旗,152531|多倫縣,152900|阿拉善盟,152921|阿拉善左旗,152922|阿拉善右旗,152923|額濟(jì)納旗,210000|遼寧省,210100|沈陽市,210101|市轄區(qū),210102|和平區(qū),210103|沈河區(qū),210104|大東區(qū),210105|皇姑區(qū),210106|鐵西區(qū),210111|蘇家屯區(qū),210112|東陵區(qū),210113|沈北新區(qū),210114|于洪區(qū),210122|遼中縣,210123|康平縣,210124|法庫縣,210181|新民市,210200|大連市,210201|市轄區(qū),210202|中山區(qū),210203|西崗區(qū),210204|沙河口區(qū),210211|甘井子區(qū),210212|旅順口區(qū),210213|金州區(qū),210224|長??h,210281|瓦房店市,210282|普蘭店市,210283|莊河市,210300|鞍山市,210301|市轄區(qū),210302|鐵東區(qū),210303|鐵西區(qū),210304|立山區(qū),210311|千山區(qū),210321|臺安縣,210323|岫巖滿族自治縣,210381|海城市,210400|撫順市,210401|市轄區(qū),210402|新?lián)釁^(qū),210403|東洲區(qū),210404|望花區(qū),210411|順城區(qū),210421|撫順縣,210422|新賓滿族自治縣,210423|清原滿族自治縣,210500|本溪市,210501|市轄區(qū),210502|平山區(qū),210503|溪湖區(qū),210504|明山區(qū),210505|南芬區(qū),210521|本溪滿族自治縣,210522|桓仁滿族自治縣,210600|丹東市,210601|市轄區(qū),210602|元寶區(qū),210603|振興區(qū),210604|振安區(qū),210624|寬甸滿族自治縣,210681|東港市,210682|鳳城市,210700|錦州市,210701|市轄區(qū),210702|古塔區(qū),210703|凌河區(qū),210711|太和區(qū),210726|黑山縣,210727|義縣,210781|凌海市,210782|北鎮(zhèn)市,210800|營口市,210801|市轄區(qū),210802|站前區(qū),210803|西市區(qū),210804|鲅魚圈區(qū),210811|老邊區(qū),210881|蓋州市,210882|大石橋市,210900|阜新市,210901|市轄區(qū),210902|海州區(qū),210903|新邱區(qū),210904|太平區(qū),210905|清河門區(qū),210911|細(xì)河區(qū),210921|阜新蒙古族自治縣,210922|彰武縣,211000|遼陽市,211001|市轄區(qū),211002|白塔區(qū),211003|文圣區(qū),211004|宏偉區(qū),211005|弓長嶺區(qū),211011|太子河區(qū),211021|遼陽縣,211081|燈塔市,211100|盤錦市,211101|市轄區(qū),211102|雙臺子區(qū),211103|興隆臺區(qū),211121|大洼縣,211122|盤山縣,211200|鐵嶺市,211201|市轄區(qū),211202|銀州區(qū),211204|清河區(qū),211221|鐵嶺縣,211223|西豐縣,211224|昌圖縣,211281|調(diào)兵山市,211282|開原市,211300|朝陽市,211301|市轄區(qū),211302|雙塔區(qū),211303|龍城區(qū),211321|朝陽縣,211322|建平縣,211324|喀喇沁左翼蒙古族自治縣,211381|北票市,211382|凌源市,211400|葫蘆島市,211401|市轄區(qū),211402|連山區(qū),211403|龍港區(qū),211404|南票區(qū),211421|綏中縣,211422|建昌縣,211481|興城市,220000|吉林省,220100|長春市,220101|市轄區(qū),220102|南關(guān)區(qū),220103|寬城區(qū),220104|朝陽區(qū),220105|二道區(qū),220106|綠園區(qū),220112|雙陽區(qū),220122|農(nóng)安縣,220181|九臺市,220182|榆樹市,220183|德惠市,220200|吉林市,220201|市轄區(qū),220202|昌邑區(qū),220203|龍?zhí)秴^(qū),220204|船營區(qū),220211|豐滿區(qū),220221|永吉縣,220281|蛟河市,220282|樺甸市,220283|舒蘭市,220284|磐石市,220300|四平市,220301|市轄區(qū),220302|鐵西區(qū),220303|鐵東區(qū),220322|梨樹縣,220323|伊通滿族自治縣,220381|公主嶺市,220382|雙遼市,220400|遼源市,220401|市轄區(qū),220402|龍山區(qū),220403|西安區(qū),220421|東豐縣,220422|東遼縣,220500|通化市,220501|市轄區(qū),220502|東昌區(qū),220503|二道江區(qū),220521|通化縣,220523|輝南縣,220524|柳河縣,220581|梅河口市,220582|集安市,220600|白山市,220601|市轄區(qū),220602|八道江區(qū),220605|江源區(qū),220621|撫松縣,220622|靖宇縣,220623|長白朝鮮族自治縣,220681|臨江市,220700|松原市,220701|市轄區(qū),220702|寧江區(qū),220721|前郭爾羅斯蒙古族自治縣,220722|長嶺縣,220723|乾安縣,220724|扶余縣,220800|白城市,220801|市轄區(qū),220802|洮北區(qū),220821|鎮(zhèn)賚縣,220822|通榆縣,220881|洮南市,220882|大安市,222400|延邊朝鮮族自治州,222401|延吉市,222402|圖們市,222403|敦化市,222404|琿春市,222405|龍井市,222406|和龍市,222424|汪清縣,222426|安圖縣,230000|黑龍江省,230100|哈爾濱市,230101|市轄區(qū),230102|道里區(qū),230103|南崗區(qū),230104|道外區(qū),230108|平房區(qū),230109|松北區(qū),230110|香坊區(qū),230111|呼蘭區(qū),230112|阿城區(qū),230123|依蘭縣,230124|方正縣,230125|賓縣,230126|巴彥縣,230127|木蘭縣,230128|通河縣,230129|延壽縣,230182|雙城市,230183|尚志市,230184|五常市,230200|齊齊哈爾市,230201|市轄區(qū),230202|龍沙區(qū),230203|建華區(qū),230204|鐵鋒區(qū),230205|昂昂溪區(qū),230206|富拉爾基區(qū),230207|碾子山區(qū),230208|梅里斯達(dá)斡爾族區(qū),230221|龍江縣,230223|依安縣,230224|泰來縣,230225|甘南縣,230227|富??h,230229|克山縣,230230|克東縣,230231|拜泉縣,230281|訥河市,230300|雞西市,230301|市轄區(qū),230302|雞冠區(qū),230303|恒山區(qū),230304|滴道區(qū),230305|梨樹區(qū),230306|城子河區(qū),230307|麻山區(qū),230321|雞東縣,230381|虎林市,230382|密山市,230400|鶴崗市,230401|市轄區(qū),230402|向陽區(qū),230403|工農(nóng)區(qū),230404|南山區(qū),230405|興安區(qū),230406|東山區(qū),230407|興山區(qū),230421|蘿北縣,230422|綏濱縣,230500|雙鴨山市,230501|市轄區(qū),230502|尖山區(qū),230503|嶺東區(qū),230505|四方臺區(qū),230506|寶山區(qū),230521|集賢縣,230522|友誼縣,230523|寶清縣,230524|饒河縣,230600|大慶市,230601|市轄區(qū),230602|薩爾圖區(qū),230603|龍鳳區(qū),230604|讓胡路區(qū),230605|紅崗區(qū),230606|大同區(qū),230621|肇州縣,230622|肇源縣,230623|林甸縣,230624|杜爾伯特蒙古族自治縣,230700|伊春市,230701|市轄區(qū),230702|伊春區(qū),230703|南岔區(qū),230704|友好區(qū),230705|西林區(qū),230706|翠巒區(qū),230707|新青區(qū),230708|美溪區(qū),230709|金山屯區(qū),230710|五營區(qū),230711|烏馬河區(qū),230712|湯旺河區(qū),230713|帶嶺區(qū),230714|烏伊嶺區(qū),230715|紅星區(qū),230716|上甘嶺區(qū),230722|嘉蔭縣,230781|鐵力市,230800|佳木斯市,230801|市轄區(qū),230803|向陽區(qū),230804|前進(jìn)區(qū),230805|東風(fēng)區(qū),230811|郊區(qū),230822|樺南縣,230826|樺川縣,230828|湯原縣,230833|撫遠(yuǎn)縣,230881|同江市,230882|富錦市,230900|七臺河市,230901|市轄區(qū),230902|新興區(qū),230903|桃山區(qū),230904|茄子河區(qū),230921|勃利縣,231000|牡丹江市,231001|市轄區(qū),231002|東安區(qū),231003|陽明區(qū),231004|愛民區(qū),231005|西安區(qū),231024|東寧縣,231025|林口縣,231081|綏芬河市,231083|海林市,231084|寧安市,231085|穆棱市,231100|黑河市,231101|市轄區(qū),231102|愛輝區(qū),231121|嫩江縣,231123|遜克縣,231124|孫吳縣,231181|北安市,231182|五大連池市,231200|綏化市,231201|市轄區(qū),231202|北林區(qū),231221|望奎縣,231222|蘭西縣,231223|青岡縣,231224|慶安縣,231225|明水縣,231226|綏棱縣,231281|安達(dá)市,231282|肇東市,231283|海倫市,232700|大興安嶺地區(qū),232721|呼瑪縣,232722|塔河縣,232723|漠河縣,310000|上海市,310100|市轄區(qū),310101|黃浦區(qū),310103|盧灣區(qū),310104|徐匯區(qū),310105|長寧區(qū),310106|靜安區(qū),310107|普陀區(qū),310108|閘北區(qū),310109|虹口區(qū),310110|楊浦區(qū),310112|閔行區(qū),310113|寶山區(qū),310114|嘉定區(qū),310115|浦東新區(qū),310116|金山區(qū),310117|松江區(qū),310118|青浦區(qū),310119|南匯區(qū),310120|奉賢區(qū),310200|縣,310230|崇明縣,320000|江蘇省,320100|南京市,320101|市轄區(qū),320102|玄武區(qū),320103|白下區(qū),320104|秦淮區(qū),320105|建鄴區(qū),320106|鼓樓區(qū),320107|下關(guān)區(qū),320111|浦口區(qū),320113|棲霞區(qū),320114|雨花臺區(qū),320115|江寧區(qū),320116|六合區(qū),320124|溧水縣,320125|高淳縣,320200|無錫市,320201|市轄區(qū),320202|崇安區(qū),320203|南長區(qū),320204|北塘區(qū),320205|錫山區(qū),320206|惠山區(qū),320211|濱湖區(qū),320281|江陰市,320282|宜興市,320300|徐州市,320301|市轄區(qū),320302|鼓樓區(qū),320303|云龍區(qū),320304|九里區(qū),320305|賈汪區(qū),320311|泉山區(qū),320321|豐縣,320322|沛縣,320323|銅山縣,320324|睢寧縣,320381|新沂市,320382|邳州市,320400|常州市,320401|市轄區(qū),320402|天寧區(qū),320404|鐘樓區(qū),320405|戚墅堰區(qū),320411|新北區(qū),320412|武進(jìn)區(qū),320481|溧陽市,320482|金壇市,320500|蘇州市,320501|市轄區(qū),320502|滄浪區(qū),320503|平江區(qū),320504|金閶區(qū),320505|虎丘區(qū),320506|吳中區(qū),320507|相城區(qū),320581|常熟市,320582|張家港市,320583|昆山市,320584|吳江市,320585|太倉市,320600|南通市,320601|市轄區(qū),320602|崇川區(qū),320611|港閘區(qū),320621|海安縣,320623|如東縣,320681|啟東市,320682|如皋市,320683|通州市,320684|海門市,320700|連云港市,320701|市轄區(qū),320703|連云區(qū),320705|新浦區(qū),320706|海州區(qū),320721|贛榆縣,320722|東??h,320723|灌云縣,320724|灌南縣,320800|淮安市,320801|市轄區(qū),320802|清河區(qū),320803|楚州區(qū),320804|淮陰區(qū),320811|清浦區(qū),320826|漣水縣,320829|洪澤縣,320830|盱眙縣,320831|金湖縣,320900|鹽城市,320901|市轄區(qū),320902|亭湖區(qū),320903|鹽都區(qū),320921|響水縣,320922|濱??h,320923|阜寧縣,320924|射陽縣,320925|建湖縣,320981|東臺市,320982|大豐市,321000|揚(yáng)州市,321001|市轄區(qū),321002|廣陵區(qū),321003|邗江區(qū),321011|維揚(yáng)區(qū),321023|寶應(yīng)縣,321081|儀征市,321084|高郵市,321088|江都市,321100|鎮(zhèn)江市,321101|市轄區(qū),321102|京口區(qū),321111|潤州區(qū),321112|丹徒區(qū),321181|丹陽市,321182|揚(yáng)中市,321183|句容市,321200|泰州市,321201|市轄區(qū),321202|海陵區(qū),321203|高港區(qū),321281|興化市,321282|靖江市,321283|泰興市,321284|姜堰市,321300|宿遷市,321301|市轄區(qū),321302|宿城區(qū),321311|宿豫區(qū),321322|沭陽縣,321323|泗陽縣,321324|泗洪縣,330000|浙江省,330100|杭州市,330101|市轄區(qū),330102|上城區(qū),330103|下城區(qū),330104|江干區(qū),330105|拱墅區(qū),330106|西湖區(qū),330108|濱江區(qū),330109|蕭山區(qū),330110|余杭區(qū),330122|桐廬縣,330127|淳安縣,330182|建德市,330183|富陽市,330185|臨安市,330200|寧波市,330201|市轄區(qū),330203|海曙區(qū),330204|江東區(qū),330205|江北區(qū),330206|北侖區(qū),330211|鎮(zhèn)海區(qū),330212|鄞州區(qū),330225|象山縣,330226|寧海縣,330281|余姚市,330282|慈溪市,330283|奉化市,330300|溫州市,330301|市轄區(qū),330302|鹿城區(qū),330303|龍灣區(qū),330304|甌海區(qū),330322|洞頭縣,330324|永嘉縣,330326|平陽縣,330327|蒼南縣,330328|文成縣,330329|泰順縣,330381|瑞安市,330382|樂清市,330400|嘉興市,330401|市轄區(qū),330402|南湖區(qū),330411|秀洲區(qū),330421|嘉善縣,330424|海鹽縣,330481|海寧市,330482|平湖市,330483|桐鄉(xiāng)市,330500|湖州市,330501|市轄區(qū),330502|吳興區(qū),330503|南潯區(qū),330521|德清縣,330522|長興縣,330523|安吉縣,330600|紹興市,330601|市轄區(qū),330602|越城區(qū),330621|紹興縣,330624|新昌縣,330681|諸暨市,330682|上虞市,330683|嵊州市,330700|金華市,330701|市轄區(qū),330702|婺城區(qū),330703|金東區(qū),330723|武義縣,330726|浦江縣,330727|磐安縣,330781|蘭溪市,330782|義烏市,330783|東陽市,330784|永康市,330800|衢州市,330801|市轄區(qū),330802|柯城區(qū),330803|衢江區(qū),330822|常山縣,330824|開化縣,330825|龍游縣,330881|江山市,330900|舟山市,330901|市轄區(qū),330902|定海區(qū),330903|普陀區(qū),330921|岱山縣,330922|嵊泗縣,331000|臺州市,331001|市轄區(qū),331002|椒江區(qū),331003|黃巖區(qū),331004|路橋區(qū),331021|玉環(huán)縣,331022|三門縣,331023|天臺縣,331024|仙居縣,331081|溫嶺市,331082|臨海市,331100|麗水市,331101|市轄區(qū),331102|蓮都區(qū),331121|青田縣,331122|縉云縣,331123|遂昌縣,331124|松陽縣,331125|云和縣,331126|慶元縣,331127|景寧畬族自治縣,331181|龍泉市,340000|安徽省,340100|合肥市,340101|市轄區(qū),340102|瑤海區(qū),340103|廬陽區(qū),340104|蜀山區(qū),340111|包河區(qū),340121|長豐縣,340122|肥東縣,340123|肥西縣,340200|蕪湖市,340201|市轄區(qū),340202|鏡湖區(qū),340203|弋江區(qū),340207|鳩江區(qū),340208|三山區(qū),340221|蕪湖縣,340222|繁昌縣,340223|南陵縣,340300|蚌埠市,340301|市轄區(qū),340302|龍子湖區(qū),340303|蚌山區(qū),340304|禹會區(qū),340311|淮上區(qū),340321|懷遠(yuǎn)縣,340322|五河縣,340323|固鎮(zhèn)縣,340400|淮南市,340401|市轄區(qū),340402|大通區(qū),340403|田家庵區(qū),340404|謝家集區(qū),340405|八公山區(qū),340406|潘集區(qū),340421|鳳臺縣,340500|馬鞍山市,340501|市轄區(qū),340502|金家莊區(qū),340503|花山區(qū),340504|雨山區(qū),340521|當(dāng)涂縣,340600|淮北市,340601|市轄區(qū),340602|杜集區(qū),340603|相山區(qū),340604|烈山區(qū),340621|濉溪縣,340700|銅陵市,340701|市轄區(qū),340702|銅官山區(qū),340703|獅子山區(qū),340711|郊區(qū),340721|銅陵縣,340800|安慶市,340801|市轄區(qū),340802|迎江區(qū),340803|大觀區(qū),340811|宜秀區(qū),340822|懷寧縣,340823|樅陽縣,340824|潛山縣,340825|太湖縣,340826|宿松縣,340827|望江縣,340828|岳西縣,340881|桐城市,341000|黃山市,341001|市轄區(qū),341002|屯溪區(qū),341003|黃山區(qū),341004|徽州區(qū),341021|歙縣,341022|休寧縣,341023|黟縣,341024|祁門縣,341100|滁州市,341101|市轄區(qū),341102|瑯琊區(qū),341103|南譙區(qū),341122|來安縣,341124|全椒縣,341125|定遠(yuǎn)縣,341126|鳳陽縣,341181|天長市,341182|明光市,341200|阜陽市,341201|市轄區(qū),341202|潁州區(qū),341203|潁東區(qū),341204|潁泉區(qū),341221|臨泉縣,341222|太和縣,341225|阜南縣,341226|潁上縣,341282|界首市,341300|宿州市,341301|市轄區(qū),341302|埇橋區(qū),341321|碭山縣,341322|蕭縣,341323|靈璧縣,341324|泗縣,341400|巢湖

jsp中利用javascript實(shí)現(xiàn)三級聯(lián)動

js代碼

//級聯(lián)菜單

var province = ['江西省','江蘇省','浙江省','甘肅省','江西省','江蘇省','浙江省','甘肅省'];

var city = Array(

new Array ('南昌市','贛州市','撫州市','上饒市'),

new Array('杭州市','溫州市','寧波市'),

new Array('南京市','蘇州市','昆山市','太倉市'),

new Array('蘭州市','敦煌市','蘭樓市'),

new Array ('南昌市','贛州市','撫州市','上饒市'),

new Array('杭州市','溫州市','寧波市'),

new Array('南京市','蘇州市','昆山市','太倉市'),

new Array('蘭州市','敦煌市','蘭樓市')

)

//遍歷省份

for(var i=0;iprovince.length;i++){

var opt = document.createElement('option'); //創(chuàng)建一個結(jié)點(diǎn)

opt.value = province[i]; //在value顯示

opt.innerHTML = opt.value; //頁面顯示

document.getElementById('big').appendChild(opt);

}

//省份值改變的時候調(diào)用函數(shù)

function show_small(){

//alert( document.getElementById('big').selectedIndex);//拿到下標(biāo)

document.getElementById('small').innerHTML="";//清空 appendChild會追加

var index = document.getElementById('big').selectedIndex;

for(var i=0;icity[index-1].length;i++){ //注意下標(biāo)

var opt = document.createElement('option');

opt.value = city[index-1][i];

opt.innerHTML = opt.value;

document.getElementById('small').appendChild(opt);

}

}

html代碼

!-- 級聯(lián)菜單--

select id="big" onchange="show_small()"

option value=""--select--/option

/select

select id="small"

option value=""--select--/option

/select

手上剛好有個二級聯(lián)動的,三級聯(lián)動的你可以自己看著加進(jìn)去,希望對你有幫助

網(wǎng)站名稱:javascript級聯(lián),級聯(lián)的連接方式
當(dāng)前鏈接:http://jinyejixie.com/article4/dsdjgie.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信小程序、小程序開發(fā)、網(wǎng)站設(shè)計公司、虛擬主機(jī)、網(wǎng)站改版、關(guān)鍵詞優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站建設(shè)網(wǎng)站維護(hù)公司
仙桃市| 漳平市| 青冈县| 社旗县| 独山县| 吴江市| 临朐县| 南陵县| 瑞金市| 莲花县| 佛教| 横山县| 康定县| 化州市| 江陵县| 闵行区| 五峰| 平定县| 尼勒克县| 威远县| 和顺县| 富顺县| 德惠市| 南澳县| 双辽市| 吉安县| 衡阳市| 江安县| 杂多县| 凉城县| 浦城县| 枣阳市| 沙洋县| 揭东县| 武宣县| 永仁县| 赞皇县| 沙河市| 塔城市| 陇川县| 原阳县|