javascript 二级动态下拉菜单选项

</tr>
<script language = "JavaScript">
var onecount2;
subcat2 = new Array();
onecount2=45;

subcat2[0] = new Array("001001","001","液晶电视");
subcat2[1] = new Array("001002","001","等离子电视");
subcat2[2] = new Array("001003","001","背投电视");
subcat2[3] = new Array("001004","001","普通电视");
subcat2[4] = new Array("002","002","冰箱");
subcat2[5] = new Array("003","003","空调");
subcat2[6] = new Array("004","004","洗衣机");
subcat2[7] = new Array("005001","005","抽油烟机");
subcat2[8] = new Array("005002","005","微波炉");
subcat2[9] = new Array("005003","005","消毒柜");
subcat2[10] = new Array("005004","005","排气换气扇");
subcat2[11] = new Array("005005","005","电磁炉");
subcat2[12] = new Array("005006","005","电火锅");
subcat2[13] = new Array("005007","005","压力锅");
subcat2[14] = new Array("005008","005","燃气灶");
subcat2[15] = new Array("005009","005","电饭煲");
subcat2[16] = new Array("005010","005","饮水机");
subcat2[17] = new Array("005011","005","电热水器");
subcat2[18] = new Array("005012","005","太阳能热水器");
subcat2[19] = new Array("005013","005","燃气热水器");
subcat2[20] = new Array("005014","005","中央热水器");
subcat2[21] = new Array("005015","005","浴霸");
subcat2[22] = new Array("006001","006","电暖器");
subcat2[23] = new Array("006002","006","加湿器");
subcat2[24] = new Array("006003","006","净化清新器");
subcat2[25] = new Array("006004","006","电风扇");
subcat2[26] = new Array("006005","006","吸尘器");
subcat2[27] = new Array("006006","006","扫地机");
subcat2[28] = new Array("006007","006","电熨斗");
subcat2[29] = new Array("006008","006","按摩椅");
subcat2[30] = new Array("006009","006","按摩器");
subcat2[31] = new Array("006010","006","血压计");
subcat2[32] = new Array("006011","006","体温计");
subcat2[33] = new Array("006012","006","计步器");
subcat2[34] = new Array("006013","006","助听器");
subcat2[35] = new Array("006014","006","剃须刀");
subcat2[36] = new Array("006015","006","脱毛器");
subcat2[37] = new Array("006016","006","电动牙刷");
subcat2[38] = new Array("006017","006","电吹风");
subcat2[39] = new Array("007001","007","套装家庭影院");
subcat2[40] = new Array("007002","007","投影机");
subcat2[41] = new Array("007003","007","AV音箱");
subcat2[42] = new Array("007004","007","迷你组合音响");
subcat2[43] = new Array("007005","007","VCD");
subcat2[44] = new Array("007006","007","DVD");
function changelocation(id)
{
document.form1.type.length = 0;
var id=id;
var j;
document.form1.type.options[0] = new Option('=产品子分类=','');
for (j=0;j < onecount2; j++)
{
if (subcat2[j][1] == id)
{
document.form1.type.options[document.form1.type.length] = new Option(subcat2[j][2], subcat2[j][0]);
}
}
}
</script>


<form name=form1 action="">

<select name="oneType" onChange="changelocation(document.form1.oneType.options[document.form1.oneType.selectedIndex].value)" size="1">
<option selected>=产品主分类=</option>
<option value="001">彩电</option>
<option value="002">冰箱</option>
<option value="003">空调</option>
<option value="004">洗衣机</option>
<option value="005">厨房卫浴</option>
<option value="006">小家电</option>
<option value="007">家庭影院</option>
</select>


<select name="type">
<option selected value="">=产品子分类=</option>
</select>

</form>

你可能感兴趣的:(JavaScript,J#)