<!DOCTOPE html>
<html>
<head lang="en">
<meta charset="UTF-8"/>
</head>
<body>
<select class="one">
<option>未选择</option>
</select>
<select class="two">
<option>未选择</option>
</select>
<select class="three">
<option>未选择</option>
</select>
<body>
[1,[11,[111,112,113]],[12,[121,122,123]],[13,[131,132,133]]],
[2,[21,[211,212,213]],[22,[221,222,223]],[23,[231,232,233]]],
[3,[33,[331,312,313]],[32,[321,322,323]],[33,[331,332,333]]],
for(var i=0;i<3;i++){
$(".one").append("<option value="+i+">"+info[i][0]+"</option>");
}
all_option($(".two option"),$(".two"),$(this).val(),0);
all_option($(".three option"),$(".three"),$(this).val(),1);
obj_one.remove();
obj_two.append("<option>未选择</option>");
if(val!="未选择"){
for(var i=0;i<3;i++){
if(z==0)
obj_two.append("<option value="+i+">"+info[val][i+1][0]+"</option>");
if(z==1)
obj_two.append("<option>"+info[$(".one").val()][parseInt(val)+1][1][i]+"</option>");
}
}
}
</script>
<html>
<head lang="en">
<meta charset="UTF-8"/>
</head>
<body>
<select class="one">
<option>未选择</option>
</select>
<select class="two">
<option>未选择</option>
</select>
<select class="three">
<option>未选择</option>
</select>
<body>
</html>
//加载JQuery 函数
<script>
// 创建一个数组
[1,[11,[111,112,113]],[12,[121,122,123]],[13,[131,132,133]]],
[2,[21,[211,212,213]],[22,[221,222,223]],[23,[231,232,233]]],
[3,[33,[331,312,313]],[32,[321,322,323]],[33,[331,332,333]]],
];
//加载开始选项
for(var i=0;i<3;i++){
$(".one").append("<option value="+i+">"+info[i][0]+"</option>");
}
})
// 加载第二级菜单
all_option($(".two option"),$(".two"),$(this).val(),0);
});
// 加载第三级菜单
all_option($(".three option"),$(".three"),$(this).val(),1);
});
//通用的函数加载菜单
obj_one.remove();
obj_two.append("<option>未选择</option>");
if(val!="未选择"){
for(var i=0;i<3;i++){
if(z==0)
obj_two.append("<option value="+i+">"+info[val][i+1][0]+"</option>");
if(z==1)
obj_two.append("<option>"+info[$(".one").val()][parseInt(val)+1][1][i]+"</option>");
}
}
}
</script>