文章只是分享自己作业的答案并不是原创
HTML代码部分
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>省份二级联动</title>
<script src="js文件地址"></script>
</head>
<body>
省:<select id="provice">
</select>
市:<select id="city">
</select>
</body>
</html>
js代码部分
var cityData = [{
"code": "001",
"name": "广东省",
"cities": [{
"code": "0011",
"name": "广州市"
}, {
"code": "0012",
"name": "深圳市"
}, {
"code": "0013",
"name": "东莞市"
}, {
"code": "0014",