<html>
<head>
<title>下拉列表与图片</title>
<script type="text/javascript" language="javascript">
var province = ['河北省', '河南省', '湖北省', '湖南省']
province['河北省'] = ['石家庄', '保定', '廊坊', '张家口', '承德', '唐山', '邯郸']
province['河南省'] = ['郑州', '开封', '洛阳', '平顶山', '许昌', '周口', '川汇']
province['湖北省'] = ['武汉', '黄石', '荆州', '天门', '潜江', '随州', '仙桃']
province['湖南省'] = ['长沙', '湘潭', '湘乡', '衡阳', '耒阳', '岳阳', '临湘']
province['河北省']['邯郸'] = ['峰峰矿区', '彭城']
function showpro(value) {
var city = document.getElementById("city")
city.options.length = 0
for (var i = 0i <province[value].lengthi++) {
var opt = document.createElement("OPTION")
opt.text = province[value][i]
opt.value = province[value][i]
city.options.add(opt)
}
}
function showan(value) {
var an = document.getElementById("an")
var pro = document.getElementById("province").value
an.options.length = 0
for (var i = 0i <province[pro][value].lengthi++) {
var opt = document.createElement("OPTION")
opt.text = province[pro][value][i]
opt.value = province[pro][value][i]
an.options.add(opt)
}
}
</script>
</head>
<body>
<select onchange="showpro(this.value)" id="province">
<option value="河北省">河北省</option>
<option value="河南省">河南省</option>
<option value="湖北省">湖北省</option>
<option value="湖南省">湖南省</option>
</select>
<select onchange="showan(this.value)" id="city">
</select>
<select id="an">
</select>
</body>
</html>
var arr = []for (var i = 0 i < 3 i++) {
arr[i] = []
for (var j = 0 j < i+1 j++) {
arr[i][j] = []
for (var z = 0 z < 3 z++) {
var v = ''
if(z==0){
k = 'A'
v='abc'
}else if(z==1){
k = 'B'
v='2017'
}else if(z==2){
k = 'C'
v='aa'
}
arr[i][j][k] = v
}
}
}
console.log(arr) 望采纳,不懂请追问