javawscript 三级菜单的实现原理

(编辑:jimmy 日期: 2024/10/13 浏览:2)

省份: 城市: 区县:

省份,城市,区县数据结构:【名称,父类ID,当前ID】

 onChange="changelocation2(document.editForm.smalllocation.options[document.editForm.smalllocation.selectedIndex].value)"

根据selectedIndex取得下一级关联菜单的父类ID,
复制代码 代码如下:
function changelocation(locationid)
{
document.editForm.smalllocation.length = 0;
// document.editForm.dlmc0.length = 0;
document.getElementById("dlmc0").length=0;
//document.editForm.dlmc0.options[0] = new Option('==请选择==','');
document.getElementById("dlmc0").options[0] = new Option('==请选择==','');

//alert(locationid);
var locationid=locationid;
var i;
document.editForm.smalllocation.options[0] = new Option('==请选择==','');
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.editForm.smalllocation.options[document.editForm.smalllocation.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}

一句话新闻

Windows上运行安卓你用过了吗
在去年的5月23日,借助Intel Bridge Technology以及Intel Celadon两项技术的驱动,Intel为PC用户带来了Android On Windows(AOW)平台,并携手国内软件公司腾讯共同推出了腾讯应用宝电脑版,将Windows与安卓两大生态进行了融合,PC的使用体验随即被带入到了一个全新的阶段。