<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>二级联动菜单</title>
</head>
<link rel="stylesheet" href="../插件/bootstrap.min.css">
<body>
<div class="container">
<div class="input-group">
<select class="custom-select aa col" id="inputGroupSelect01">
<option selected>...</option>
</select>
<select id="dd" class="col">
<option selected></option>
</select>
</div>
</div>
<script src="../插件/jquery-3.4.1.min.js"></script>
<script src="../插件/bootstrap-4.5.0-dist/js/bootstrap.bundle.min.js"></script>
<script>
$(function(){
var arr = ["广东", "四川", "湖北", "山东", "湖南", "黑龙江"];
$.each(arr,function(index,item){
$("#inputGroupSelect01").append('<option value='+index+'>'+item+'</option>');
});
});
$(".aa").click(function(){
var ss=$(".custom-select").val();
$("#dd").removeClass();
$("#dd").empty();
$("#dd").addClass('col inputGroupSelect'+ss+'')
var arr0 = ["广州市","深圳市","珠海市","汕头市","佛山市","韶关市","湛江市","肇庆市","江门市","茂名市","惠州市","梅州市","汕尾市","河源市","阳江市","清远市","东莞市","中山市","潮州市","揭阳市","云浮市","..."];
$.each(arr0,function(index,item){
$(".inputGroupSelect0").append('<option selected>'+item+'</option>');
});
var arr1 = ["成都市","绵阳市","德阳市","攀枝花市","遂宁市","南充市","广元市","乐山市","宜宾市","泸州市","达州市","广安市","巴中市","雅安市","内江市","自贡市","资阳市","眉山市","..."];
$.each(arr1,function(index,item){
$(".inputGroupSelect1").append('<option selected>'+item+'</option>');
});
var arr2 = ["武汉市","黄石市","十堰市","荆州市","宜昌市","襄阳市","鄂州市","荆门市","孝感市","黄冈市","咸宁市","随州市","..."];
$.each(arr2,function(index,item){
$(".inputGroupSelect2").append('<option selected>'+item+'</option>');
});
var arr3 = ["济南市","青岛市","淄博市","枣庄市","东营市","烟台市","潍坊市","济宁市","泰安市","威海市","日照市","滨州市","德州市","聊城市","临沂市","菏泽市","莱芜市","..."];
$.each(arr3,function(index,item){
$(".inputGroupSelect3").append('<option selected>'+item+'</option>');
});
var arr4 = ["长沙市","株洲市","湘潭市","衡阳市","邵阳市","岳阳市","常德市","张家界市","益阳市","娄底市","郴州市","永州市","怀化市","..."];
$.each(arr4,function(index,item){
$(".inputGroupSelect4").append('<option selected>'+item+'</option>');
});
var arr5 = ["哈尔滨市","齐齐哈尔市","牡丹江市","佳木斯市","七台河市","大庆市","黑河市","绥化市","伊春市","鹤岗市","双鸭山市","鸡西市","..."];
$.each(arr5,function(index,item){
$(".inputGroupSelect5").append('<option selected>'+item+'</option>');
});
})
</script>
</body>
</html>