省市二級聯動下拉框

2021-10-10 21:34:09 字數 964 閱讀 4627

<

!doctype html>

"zh"

>

"utf-8"

>

"viewport" content=

"width=device-width, initial-scale=1.0"

>

省市二級聯動<

/title>

<

/head>

"">

省份:"" id=

"province"

>

<

/select>

城市:"" id=

"city"

>

<

/select>

<

/form>

//將城市資訊新增

var provinces =

["請選擇省份"

,"湖北省"

,"安徽省"];

var cities =[[

"請選擇城市"],

["武漢市"

,"黃石市"],

["合肥市"

,"阜陽市"]]

//獲取select的dom節點

var province = document.

getelementbyid

("province");

var city = document.

getelementbyid

("city");

//向省份列表新增元素

for(

var value of provinces)

//當省份改變時,聯動對應的城市

province.

onchange

=function()

}<

/script>

<

/body>

<

/html>

python下拉框二級聯動 antd下拉框聯動說明

先說一下效果要求,上面乙個下拉框,下面乙個,要求上面選中的時候,下面的內容要跟著變。因為想到react是資料驅動的,就不打算再用jq的那種隱藏顯示了,而是通過在執行型別下拉框的onchange事件中,去改變下面的下拉框的資料,渲染出不同的下拉選擇。定義資料 modeoptions是各個下拉框的值,由...

Jeesite下拉框的二級聯動

話不多說 首先上 jsp 頁面 截圖 第乙個下拉框jsp class control group class control label 離職型別 label class controls id type name type path type class input xlarge onchange...

easyui省市二級聯動

easyui省市二級聯動 1 html 所屬區域 2 js 3 php todo 得到省市資訊,根據引數pid是否存在判斷是省還是市 public function getprovincecityaction else else arealist marea getlist where,id,nam...