关于两个联动下拉框的问题?
function changemenu(bigclassid)
{
document.form1.zp_smallclass.length = 0;
var locationid=bigclassid;
var i;
for (i=0;i<document.form1.hiddsmallclass.length; i++)//循环子菜单长度,如果是二级联动,取第三及的值
{
var hiddsmallvalue=document.form1.hiddsmallclass.options[i].value
if (hiddsmallvalue.substr(4,2)==locationid.substr(4,2))
{
document.form1.zp_smallclass.options[document.form1.zp_smallclass.length] = new Option(document.form1.hiddsmallclass.options[i].text,document.form1.hiddsmallclass.options[i].value);
}
}
}
为什么document.form1.zp_smallclass.length要赋值为0呢?
还有这个new Option(document.form1.hiddsmallclass.options[i].text,document.form1.hiddsmallclass.options[i].value);是建立一个下拉框的数组语句!
但是它怎么可以做出<option value=""></option>这段代码