`

省市二级联动下拉列表框

阅读更多
网页linkage.htm内容如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>省市二级联动菜单Demo</title>
<script src="linkage.js"></script>
</head>

<body>
<h1>省市二级联动菜单Demo</h1>
<h2>点击下拉菜单选择省市</h2>
<form action="#" name="form1">
<select name="province"></select>
<br />
<select name="city"></select>
</form>
<h2>点击按钮自定义选择省市</h2>
<button onclick="setProvCity('上海','金山');">点我选择“上海”,“金山”</button>
</body>
</html>

js文件linkage.js内容如下:
/**
* 省市二级联动菜单
* honse163@163.com
* http://ahomeeye.iteye.com
*
* 通过简单设置创建省市二级联动菜单
* 使用方法:
* 1. Head 区域导入该JS文件
* 2. 在需要加上二连菜单的两个Select上分别设置name属性为 province 和 city
* 3. 刷新页面
*
*/

function pc_init(){
var province, city, _t;
_t = _findPC();

province = _t[0];
city = _t[1];

if(province && city){
_creatprovince(province);
province.onchange = function(){
_initcity(province, city);
};
}
}

function setProvCity(prov, city){
var _t = _findPC();
var _select = function(obj, value){
var o = obj.options;
for(var i=0 in o){
if(o[i] && o[i].value && o[i].value==value)o[i].selected = true;
};
};
_select(_t[0], prov);
_initcity(_t[0],_t[1]);
_select(_t[1], city);
}

function _findPC(){
var _selects = document.getElementsByTagName("select");
var _province, _city = null;
for(var i=0 in _selects){
if(_selects[i].name && 'province' == _selects[i].name) _province = _selects[i];
if(_selects[i].name && 'city' == _selects[i].name) _city = _selects[i];
}
return [_province, _city];
}

function _initcity(province, city) {
    switch (province.value) {
        case "安徽" :
            var cityOptions = new Array(
            "合肥(*)", "合肥",
            "安庆", "安庆",
            "蚌埠", "蚌埠",
            "亳州", "亳州",
            "巢湖", "巢湖",
            "滁州", "滁州",
            "阜阳", "阜阳",
            "贵池", "贵池",
            "淮北", "淮北",
            "淮化", "淮化",
            "淮南", "淮南",
            "黄山", "黄山",
            "九华山", "九华山",
            "六安", "六安",
            "马鞍山", "马鞍山",
            "宿州", "宿州",
            "铜陵", "铜陵",
            "屯溪", "屯溪",
            "芜湖", "芜湖",
            "宣城", "宣城");
             break;
        case "北京" :
            var cityOptions = new Array(
            "东城", "东城",
            "西城", "西城",
            "崇文", "崇文",
            "宣武", "宣武",
            "朝阳", "朝阳",
            "丰台", "丰台",
            "石景山", "石景山",
            "海淀", "海淀",
            "门头沟", "门头沟",
            "房山", "房山",
            "通州", "通州",
            "顺义", "顺义",
            "昌平", "昌平",
            "大兴", "大兴",
            "平谷", "平谷",
            "怀柔", "怀柔",
            "密云", "密云",
            "延庆", "延庆");
            break;
        case "重庆" :
            var cityOptions = new Array(
            "万州", "万州",
            "涪陵", "涪陵",
            "渝中", "渝中",
            "大渡口", "大渡口",
            "江北", "江北",
            "沙坪坝", "沙坪坝",
            "九龙坡","九龙坡",
            "南岸", "南岸",
            "北碚", "北碚",
            "万盛", "万盛",
            "双挢", "双挢",
            "渝北", "渝北",
            "巴南", "巴南",
            "黔江", "黔江",
            "长寿", "长寿",
            "綦江", "綦江",
            "潼南", "潼南",
            "铜梁", "铜梁",
            "大足", "大足",
            "荣昌", "荣昌",
            "壁山", "壁山",
            "梁平", "梁平",
            "城口", "城口",
            "丰都", "丰都",
            "垫江", "垫江",
            "武隆", "武隆",
            "忠县", "忠县",
            "开县", "开县",
            "云阳", "云阳",
            "奉节", "奉节",
            "巫山", "巫山",
            "巫溪", "巫溪",
            "石柱", "石柱",
            "秀山", "秀山",
            "酉阳", "酉阳",
            "彭水", "彭水",
            "江津", "江津",
            "合川", "合川",
            "永川", "永川",
            "南川", "南川");
            break;
        case "福建" :
            var cityOptions = new Array(
            "福州(*)", "福州",
            "福安", "福安",
            "龙岩", "龙岩",
            "南平", "南平",
            "宁德", "宁德",
            "莆田", "莆田",
            "泉州", "泉州",
            "三明", "三明",
            "邵武", "邵武",
            "石狮", "石狮",
            "永安", "永安",
            "武夷山", "武夷山",
            "厦门", "厦门",
            "漳州", "漳州");
             break;
        case "甘肃" :
            var cityOptions = new Array(
            "兰州(*)", "兰州",
            "白银", "白银",
            "定西", "定西",
            "敦煌", "敦煌",
            "甘南", "甘南",
            "金昌", "金昌",
            "酒泉", "酒泉",
            "临夏", "临夏",
            "平凉", "平凉",
            "天水", "天水",
            "武都", "武都",
            "武威", "武威",
            "西峰", "西峰",
            "张掖", "张掖");
            break;
        case "广东" :
            var cityOptions = new Array(
            "广州(*)", "广州",
            "潮阳", "潮阳",
            "潮州", "潮州",
            "澄海", "澄海",
            "东莞", "东莞",
            "佛山", "佛山",
            "河源", "河源",
            "惠州", "惠州",
            "江门", "江门",
            "揭阳", "揭阳",
            "开平", "开平",
            "茂名", "茂名",
            "梅州", "梅州",
            "清远", "清远",
            "汕头", "汕头",
            "汕尾", "汕尾",
            "韶关", "韶关",
            "深圳", "深圳",
            "顺德", "顺德",
            "阳江", "阳江",
            "英德", "英德",
            "云浮", "云浮",
            "增城", "增城",
            "湛江", "湛江",
            "肇庆", "肇庆",
            "中山", "中山",
            "珠海", "珠海");
            break;
        case "广西" :
            var cityOptions = new Array(
            "南宁(*)", "南宁",
            "百色", "百色",
            "北海", "北海",
            "桂林", "桂林",
            "防城港", "防城港",
            "河池", "河池",
            "贺州", "贺州",
            "柳州", "柳州",
            "钦州", "钦州",
            "梧州", "梧州",
            "玉林", "玉林");
            break;
        case "贵州" :
            var cityOptions = new Array(
            "贵阳(*)", "贵阳",
            "安顺", "安顺",
            "毕节", "毕节",
            "都匀", "都匀",
            "凯里", "凯里",
            "六盘水", "六盘水",
            "铜仁", "铜仁",
            "兴义", "兴义",
            "玉屏", "玉屏",
            "遵义", "遵义");
            break;
        case "海南" :
            var cityOptions = new Array(
            "海口(*)", "海口",
            "儋县", "儋县",
            "陵水", "陵水",
            "琼海", "琼海",
            "三亚", "三亚",
            "通什", "通什",
            "万宁", "万宁");
            break;
        case "河北" :
            var cityOptions = new Array(
            "石家庄(*)", "石家庄",
            "保定", "保定",
            "北戴河", "北戴河",
            "沧州", "沧州",
            "承德", "承德",
            "丰润", "丰润",
            "邯郸", "邯郸",
            "衡水", "衡水",
            "廊坊", "廊坊",
            "南戴河", "南戴河",
            "秦皇岛", "秦皇岛",
            "唐山", "唐山",
            "新城", "新城",
            "邢台", "邢台",
            "张家口", "张家口");
            break;
        case "黑龙江" :
            var cityOptions = new Array(
            "哈尔滨(*)", "哈尔滨",
            "北安", "北安",
            "大庆", "大庆",
            "大兴安岭", "大兴安岭",
            "鹤岗", "鹤岗",
            "黑河", "黑河",
            "佳木斯", "佳木斯",
            "鸡西", "鸡西",
            "牡丹江", "牡丹江",
            "齐齐哈尔", "齐齐哈尔",
            "七台河", "七台河",
            "双鸭山", "双鸭山",
            "绥化", "绥化",
            "伊春", "伊春");
            break;
        case "河南" :
            var cityOptions = new Array(
            "郑州(*)", "郑州",
            "安阳", "安阳",
            "鹤壁", "鹤壁",
            "潢川", "潢川",
            "焦作", "焦作",
            "济源", "济源",
            "开封", "开封",
            "漯河", "漯河",
            "洛阳", "洛阳",
            "南阳", "南阳",
            "平顶山", "平顶山",
            "濮阳", "濮阳",
            "三门峡", "三门峡",
            "商丘", "商丘",
            "新乡", "新乡",
            "信阳", "信阳",
            "许昌", "许昌",
            "周口", "周口",
            "驻马店", "驻马店");
            break;
        case "香港" :
            var cityOptions = new Array(
            "香港", "香港",
            "九龙", "九龙",
            "新界", "新界");
            break;
        case "湖北" :
            var cityOptions = new Array(
            "武汉(*)", "武汉",
            "恩施", "恩施",
            "鄂州", "鄂州",
            "黄冈", "黄冈",
            "黄石", "黄石",
            "荆门", "荆门",
            "荆州", "荆州",
            "潜江", "潜江",
            "十堰", "十堰",
            "随州", "随州",
            "武穴", "武穴",
            "仙桃", "仙桃",
            "咸宁", "咸宁",
            "襄阳", "襄阳",
            "襄樊", "襄樊",
            "孝感", "孝感",
            "宜昌", "宜昌");
            break;
        case "湖南" :
            var cityOptions = new Array(
            "长沙(*)", "长沙",
            "常德", "常德",
            "郴州", "郴州",
            "衡阳", "衡阳",
            "怀化", "怀化",
            "吉首", "吉首",
            "娄底", "娄底",
            "邵阳", "邵阳",
            "湘潭", "湘潭",
            "益阳", "益阳",
            "岳阳", "岳阳",
            "永州", "永州",
            "张家界", "张家界",
            "株洲", "株洲");
            break;
        case "江苏" :
            var cityOptions = new Array(
            "南京(*)", "南京",
            "常熟", "常熟",
            "常州", "常州",
            "海门", "海门",
            "淮安", "淮安",
            "江都", "江都",
            "江阴", "江阴",
            "昆山", "昆山",
            "连云港", "连云港",
            "南通", "南通",
            "启东", "启东",
            "沭阳", "沭阳",
            "宿迁", "宿迁",
            "苏州", "苏州",
            "太仓", "太仓",
            "泰州", "泰州",
            "同里", "同里",
            "无锡", "无锡",
            "徐州", "徐州",
            "盐城", "盐城",
            "扬州", "扬州",
            "宜兴", "宜兴",
            "仪征", "仪征",
            "张家港", "张家港",
            "镇江", "镇江",
            "周庄", "周庄");
            break;
        case "江西" :
            var cityOptions = new Array(
            "南昌(*)", "南昌",
            "抚州", "抚州",
            "赣州", "赣州",
            "吉安", "吉安",
            "景德镇", "景德镇",
            "井冈山", "井冈山",
            "九江", "九江",
            "庐山", "庐山",
            "萍乡", "萍乡",
            "上饶", "上饶",
            "新余", "新余",
            "宜春", "宜春",
            "鹰潭", "鹰潭");
            break;
        case "吉林" :
            var cityOptions = new Array(
            "长春(*)", "长春",
            "白城", "白城",
            "白山", "白山",
            "珲春", "珲春",
            "辽源", "辽源",
            "梅河", "梅河",
            "吉林", "吉林",
            "四平", "四平",
            "松原", "松原",
            "通化", "通化",
            "延吉", "延吉");
            break;
        case "辽宁" :
            var cityOptions = new Array(
            "沈阳(*)", "沈阳",
            "鞍山", "鞍山",
            "本溪", "本溪",
            "朝阳", "朝阳",
            "大连", "大连",
            "丹东", "丹东",
            "抚顺", "抚顺",
            "阜新", "阜新",
            "葫芦岛", "葫芦岛",
            "锦州", "锦州",
            "辽阳", "辽阳",
            "盘锦", "盘锦",
            "铁岭", "铁岭",
            "营口", "营口");
            break;
        case "澳门" :
            var cityOptions = new Array(
            "澳门", "澳门");
            break;
        case "内蒙古" :
            var cityOptions = new Array(
            "呼和浩特(*)", "呼和浩特",
            "阿拉善盟", "阿拉善盟",
            "包头", "包头",
            "赤峰", "赤峰",
            "东胜", "东胜",
            "海拉尔", "海拉尔",
            "集宁", "集宁",
            "临河", "临河",
            "通辽", "通辽",
            "乌海", "乌海",
            "乌兰浩特", "乌兰浩特",
            "锡林浩特", "锡林浩特");
            break;
        case "宁夏" :
            var cityOptions = new Array(
            "银川(*)", "银川",
            "固源", "固源",
            "石嘴山", "石嘴山",
            "吴忠", "吴忠");
            break;
        case "青海" :
            var cityOptions = new Array(
            "西宁(*)", "西宁",
            "德令哈", "德令哈",
            "格尔木", "格尔木",
            "共和", "共和",
            "海东", "海东",
            "海晏", "海晏",
            "玛沁", "玛沁",
            "同仁", "同仁",
            "玉树", "玉树");
            break;
        case "山东" :
            var cityOptions = new Array(
            "济南(*)", "济南",
            "滨州", "滨州",
            "兖州", "兖州",
            "德州", "德州",
            "东营", "东营",
            "菏泽", "菏泽",
            "济宁", "济宁",
            "莱芜", "莱芜",
            "聊城", "聊城",
            "临沂", "临沂",
            "蓬莱", "蓬莱",
            "青岛", "青岛",
            "曲阜", "曲阜",
            "日照", "日照",
            "泰安", "泰安",
            "潍坊", "潍坊",
            "威海", "威海",
            "烟台", "烟台",
            "枣庄", "枣庄",
            "淄博", "淄博");
            break;
        case "上海" :
            var cityOptions = new Array(
            "崇明", "崇明",
            "黄浦", "黄浦",
            "卢湾", "卢湾",
            "徐汇", "徐汇",
            "长宁", "长宁",
            "静安", "静安",
            "普陀", "普陀",
            "闸北", "闸北",
            "虹口", "虹口",
            "杨浦", "杨浦",
            "闵行", "闵行",
            "宝山", "宝山",
            "嘉定", "嘉定",
            "浦东", "浦东",
            "金山", "金山",
            "松江", "松江",
            "青浦", "青浦",
            "南汇", "南汇",
            "奉贤", "奉贤");
            break;
        case "山西" :
            var cityOptions = new Array(
            "太原(*)", "太原",
            "长治", "长治",
            "大同", "大同",
            "候马", "候马",
            "晋城", "晋城",
            "离石", "离石",
            "临汾", "临汾",
            "宁武", "宁武",
            "朔州", "朔州",
            "忻州", "忻州",
            "阳泉", "阳泉",
            "榆次", "榆次",
            "运城", "运城");
            break;
        case "陕西" :
            var cityOptions = new Array(
            "西安(*)", "西安",
            "安康", "安康",
            "宝鸡", "宝鸡",
            "汉中", "汉中",
            "渭南", "渭南",
            "商州", "商州",
            "绥德", "绥德",
            "铜川", "铜川",
            "咸阳", "咸阳",
            "延安", "延安",
            "榆林", "榆林");
            break;
        case "四川" :
            var cityOptions = new Array(
            "成都(*)", "成都",
            "巴中", "巴中",
            "达川", "达川",
            "德阳", "德阳",
            "都江堰", "都江堰",
            "峨眉山", "峨眉山",
            "涪陵", "涪陵",
            "广安", "广安",
            "广元", "广元",
            "九寨沟", "九寨沟",
            "康定", "康定",
            "乐山", "乐山",
            "泸州", "泸州",
            "马尔康", "马尔康",
            "绵阳", "绵阳",
            "眉山", "眉山",
            "南充", "南充",
            "内江", "内江",
            "攀枝花", "攀枝花",
            "遂宁", "遂宁",
            "汶川", "汶川",
            "西昌", "西昌",
            "雅安", "雅安",
            "宜宾", "宜宾",
            "自贡", "自贡",
            "资阳", "资阳");
            break;
        case "台湾" :
            var cityOptions = new Array(
            "台北(*)", "台北",
            "基隆", "基隆",
            "台南", "台南",
            "台中", "台中",
            "高雄", "高雄",
            "屏东", "屏东",
            "南投", "南投",
            "云林", "云林",
            "新竹", "新竹",
            "彰化", "彰化",
            "苗栗", "苗栗",
            "嘉义", "嘉义",
            "花莲", "花莲",
            "桃园", "桃园",
            "宜兰", "宜兰",
            "台东", "台东",
            "金门", "金门",
            "马祖", "马祖",
            "澎湖", "澎湖");
            break;
        case "天津" :
            var cityOptions = new Array(
            "天津", "天津",
            "和平", "和平",
            "东丽", "东丽",
            "河东", "河东",
            "西青", "西青",
            "河西", "河西",
            "津南", "津南",
            "南开", "南开",
            "北辰", "北辰",
            "河北", "河北",
            "武清", "武清",
            "红挢", "红挢",
            "塘沽", "塘沽",
            "汉沽", "汉沽",
            "大港", "大港",
            "宁河", "宁河",
            "静海", "静海",
            "宝坻", "宝坻",
            "蓟县", "蓟县" );
            break;
        case "新疆" :
            var cityOptions = new Array(
            "乌鲁木齐(*)", "乌鲁木齐",
            "阿克苏", "阿克苏",
            "阿勒泰", "阿勒泰",
            "阿图什", "阿图什",
            "博乐", "博乐",
            "昌吉", "昌吉",
            "东山", "东山",
            "哈密", "哈密",
            "和田", "和田",
            "喀什", "喀什",
            "克拉玛依", "克拉玛依",
            "库车", "库车",
            "库尔勒", "库尔勒",
            "奎屯", "奎屯",
            "石河子", "石河子",
            "塔城", "塔城",
            "吐鲁番", "吐鲁番",
            "伊宁", "伊宁");
            break;
        case "西藏" :
            var cityOptions = new Array(
            "拉萨(*)", "拉萨",
            "阿里", "阿里",
            "昌都", "昌都",
            "林芝", "林芝",
            "那曲", "那曲",
            "日喀则", "日喀则",
            "山南", "山南");
            break;
        case "云南" :
            var cityOptions = new Array(
            "昆明(*)", "昆明",
            "大理", "大理",
            "保山", "保山",
            "楚雄", "楚雄",
            "大理", "大理",
            "东川", "东川",
            "个旧", "个旧",
            "景洪", "景洪",
            "开远", "开远",
            "临沧", "临沧",
            "丽江", "丽江",
            "六库", "六库",
            "潞西", "潞西",
            "曲靖", "曲靖",
            "思茅", "思茅",
            "文山", "文山",
            "西双版纳", "西双版纳",
            "玉溪", "玉溪",
            "中甸", "中甸",
            "昭通", "昭通");
            break;
        case "浙江" :
            var cityOptions = new Array(
            "杭州(*)", "杭州",
            "安吉", "安吉",
            "慈溪", "慈溪",
            "定海", "定海",
            "奉化", "奉化",
            "海盐", "海盐",
            "黄岩", "黄岩",
            "湖州", "湖州",
            "嘉兴", "嘉兴",
            "金华", "金华",
            "临安", "临安",
            "临海", "临海",
            "丽水", "丽水",
            "宁波", "宁波",
            "瓯海", "瓯海",
            "平湖", "平湖",
            "千岛湖", "千岛湖",
            "衢州", "衢州",
            "江山", "江山",
            "瑞安", "瑞安",
            "绍兴", "绍兴",
            "嵊州", "嵊州",
            "台州", "台州",
            "温岭", "温岭",
            "温州", "温州",
"余姚", "余姚",
"舟山", "舟山");
            break;
        case "海外" :
            var cityOptions = new Array(
            "欧洲", "欧洲",
            "北美", "北美",
            "南美", "南美",
            "亚洲", "亚洲",
            "非洲", "非洲",
            "大洋洲", "大洋洲");
            break;
        default:
            var cityOptions = new Array("", "");
            break;
    }
city.options.length = 0;   
for(var i = 0; i < cityOptions.length/2; i++) {
    city.options[i]=new Option(cityOptions[i*2],cityOptions[i*2+1]);
    if (city.options[i].value==city){
    city.selectedIndex = i;
    }
}
}

function _creatprovince(province){
var provinces = new Array(
"北京", "上海", "重庆", "安徽", "福建", "甘肃", "广东", "广西", "贵州", "海南", "河北", "黑龙江", "河南",
"香港", "湖北", "湖南", "江苏", "江西", "吉林", "辽宁", "澳门", "内蒙古", "宁夏", "青海", "山东",
"山西", "陕西", "四川", "台湾", "天津", "新疆", "西藏", "云南", "浙江", "海外"
);
province.options[0]=new Option("选择省份","");
for(var i = 0; i < provinces.length; i++) {
    province.options[i+1]=new Option(provinces[i],provinces[i]);
if (province.options[i+1].value==province){
    province.selectedIndex = i+1;
    }
}
}

window.onload = function(){pc_init()};
分享到:
评论

相关推荐

    HTML二级联动下拉列表框的实现,如选择 省,市.zip

    HTML二级联动下拉列表框是一种常见的网页交互设计,它允许用户在两个或多个下拉菜单之间建立关联,以便根据用户在第一个下拉框中的选择动态更新第二个下拉框的内容。这种设计常见于区域选择,例如选择省份后,城市...

    二级联动 下拉列表

    二级联动 下拉列表 可以进行2级联动下拉等功效 完全的代码 用的时候只需要改改数据库就行了

    Access联动下拉列表

    Access中窗体实现二级联动下拉示范,用VBA配合SQL查询来做rowsource,实现二级下拉跟着一级内容变化,如果一级内容没有选择,二级显示所有

    js 省市区select 三级联动(全国城市三级联动下拉列表)

    本文将详细介绍如何使用JavaScript实现全国城市三级联动下拉列表,并结合提供的资源进行解析。 首先,理解“三级联动”的概念:当用户在一级下拉列表(如省份)中选择一个选项时,二级下拉列表(如城市)会根据所选...

    php代码实现二级联动下拉菜单效果

    在网页设计中,二级联动下拉菜单是一种常见的交互元素,常用于分类选择或者地区筛选等场景。这种功能的实现通常涉及到前端和后端的交互,其中PHP作为后端语言,负责处理数据并返回给前端。本篇文章将详细介绍如何...

    无刷新 省市县三级联动下拉列表

    在网页开发中,"无刷新省市县三级联动下拉列表"是一种常见的交互设计,它能够为用户提供便捷的地区选择方式,而无需页面刷新。这种功能通常应用于注册、地址填写等场景,提高用户体验并减少服务器负担。以下是关于这...

    jquery 通用三级联动下拉列表.rar

    jquery 通用三级联动下拉列表 , 用Jquery实现的三级联动下拉列表插件,压缩包内有多个不同的版本,其实现的基本原理大同小异,无非是调用方式的不同,第一个是通过读取XML构建,支持IE/firefox,chrome不支持,XML...

    省市联动下拉列表

    省市联动下拉列表是一种常见的前端交互设计,常用于地理信息选择,例如用户在填写地址时选择省份和城市。这种设计可以提高用户体验,因为用户只需在第一个下拉列表(通常是省份)中选择,第二个下拉列表(城市)就会...

    省市县(区)三级联动下拉菜单(内含省市县(区)access、sqlsever数据库)

    **文件名称列表中的“省市县(区)三级联动下拉菜单”**可能包含以下内容:HTML文件用于展示界面,CSS文件负责样式设计,JavaScript文件实现联动逻辑,以及两个数据库文件(可能是mdb格式的Access数据库和.mdf/.ldf的...

    省市区(县)三级联动下拉列表

    在网页设计中,"省市区(县)三级联动下拉列表"是一种常见的用户界面元素,主要用于用户选择他们的地理位置。这种功能通常在注册、填写地址或定位服务时使用。以下是关于这个话题的详细知识点: 1. **三级联动**:...

    Access数据库-二级下拉菜单制作

    Access数据库-二级下拉菜单制作

    Spinner二级联动下拉菜单

    "Spinner二级联动下拉菜单"是一个更复杂的功能,它涉及到两个Spinner,一个选择省份,另一个根据省份的选择动态加载并显示对应的城市。这个功能的实现涉及到多个知识点,下面将逐一详细讲解。 1. **Spinner基本使用...

    省市二级联动代码JS

    标题中的“省市二级联动代码JS”指的是在网页开发中实现的一种交互功能,它允许用户在选择省份后,自动更新下拉菜单以显示对应省份的城市,从而实现两级联动的效果。这种功能通常用于地址输入或者区域筛选等场景,...

    js省市区二级联动和三级联动下拉菜单

    二级联动的省市区选择菜单,通常包含两个下拉菜单,第一个是省份,第二个是城市。当用户在省份下拉菜单中选择一个省份时,城市下拉菜单会自动更新为对应省份的城市列表。这种联动效果可以通过监听省份下拉菜单的...

    dropdownlist 省市二级联动

    在网页开发中,"dropdownlist 省市二级联动"是一种常见的交互设计,主要用于实现用户在选择省份时,下方的下拉列表会自动更新为对应省份的城市,无需页面整体刷新。这种功能通常应用于地址填写、订单提交等场景,...

    C#中国地区三级联动下拉菜单

    3. **三级联动下拉菜单**:这是一种常见的地理选择功能,用户在第一个下拉菜单(省)中选择一个选项后,第二个下拉菜单(市)会根据所选省的数据自动更新;接着在市中选择后,第三个下拉菜单(区/县)也会相应更新。...

    JQuery省、省市二级联动、省市县/区三级联动

    在网页开发中,二级联动和三级联动通常用于创建地理区域选择功能,比如省市区选择,让用户能够方便地从一个地区列表中逐级选择。这里提到的"JQuery省、省市二级联动、省市县/区三级联动"是一个使用jQuery库实现的...

    二级省市联动框架

    在中国的Web应用开发中,"二级省市联动"是一种常见的功能设计,主要用于地址选择或区域划分。这个功能使得用户在选择省份后,下拉菜单会自动更新出与所选省份对应的市,然后再选择市时,下拉菜单又会更新出对应区县...

    android中国省市区三级联动下拉列表源码

    在Android开发中,有时我们需要实现一个功能,让用户能够选择中国的省份、城市和区县,这就是所谓的“三级联动下拉列表”。这个功能常见于地址输入、定位服务等场景。本项目提供了一个完整的Android工程源码,专门...

Global site tag (gtag.js) - Google Analytics