jsp页面上面有两个select,要当上面的select的option change的时候,下面的select 中的option也跟着变
上面的:
<select name="type" style="width=152" οnchange="changeFiles()">
<option value="1" >议案</option>
<option value="2" >建议</option>
</select>
下面的有两个列表,已经都得到了,要当上面的select的option=1的时候,下面的select显示第一个列表
上面的option=2的时候,下面的select显示第二个列表
changeFiles()应该怎么写。
================================================================================
<select name="type" style="width=152" οnchange="changeFiles(this)">
<option value="1" >议案</option>
<option value="2" >建议</option>
</select>
<select id=nn><option>11111111</select>
<select id=mm style="display: none"><option>22222222</select>
<SCRIPT LANGUAGE="JavaScript">
function changeFiles(e)
{
var mm = document.all.mm;
var nn = document.all.nn;
nn.style.display = e.value==1 ? "" : "none";
mm.style.display = e.value==1 ? "none" : "";
}
</SCRIPT>