[求助]下拉菜单和文本框的联动怎样实现?
下拉菜单有两个选项,选A时不显示文本框,选B时显示文本框,请问怎么做?
[CODE]<script language="javascript" >
function SelTest_Change()
{
var SelIdx=this.SelTest.selectedIndex;
var selOpt=this.SelTest.options[SelIdx];
switch(selOpt.value)
{
case "A":
this.ShowText.style.display="none";
break;
case "B":
this.ShowText.style.display="inline";
break;
}
}
</script>
<select name="SelTest" onChange="SelTest_Change();" >
<option selected >请选择</option>
<option value="A">A</option>
<option value="B">B</option>
</select>
<div id="ShowText" style="display:none" ><input type="text" name="TxtTest" ></div>[/CODE]