级联菜单问题
本人菜鸟 希望各位高手帮忙写个注释 在此谢谢了特别是带问号的地方
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript" src="docTool.js"></script>
<script type="text/javascript">
function selCity()
{
var arr =[['--选择城市--'],
["海淀区","朝阳区","东城区","西城区"],
["沈阳","大连","鞍山","抚顺"],
["济南","青岛","烟台","威海"],
["洛阳","郑州","开封","南阳"]];
var index = byId("selid").selectedIndex;//selectedIndex?
var subselNode = byId("subselid");
var citys = arr[index];//?
subselNode.options.length = 0;
/*for(var x=0 ; x<subselNode.options.length;)
{
subselNode.removeChild(subselNode.options[x]);
}*/
for(var x=0;x<citys.length;x++)
{
var optNode = doc.createElement("option");//?
optNode.innerText = citys[x];//?
subselNode.appendChild(optNode);//appendChild?
}
}
</script>
</head>
<body>
<select id="selid" onchange="selCity()">
<option>--选择城市--</option>
<option>北京</option>
<option>辽宁</option>
<option>山东</option>
<option>河南</option>
</select>
<select id="subselid">
<option>--选择城市--</option>
</select>
</body>
</html>