<div class="codetitle"> <span><a style="CURSOR: pointer" data="13634" class="copybut" id="copybut13634" onclick="doCopy('code13634')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code13634"> <br>; <br>; <br> <br> <br> <br><title>无标题文档</title> <br><script language="javascript"> <BR>function $(obj){return document.getElementById(obj);} <BR>function show(objid) {$(objid).style.display='inline';} <BR>function hidden(objid) {$(objid).style.display='none';} <BR>function doit(){ <BR>var sel_val=$('sel').value; <BR>if (sel_val=='') {hidden('a1');hidden('a2');} <BR>if (sel_val==0) {hidden('a1');hidden('a2');} <BR>if (sel_val==1) {show('a1');hidden('a2');} <BR>if (sel_val==2) {show('a2');hidden('a1');} <BR>} <BR></script> <br> <br><br> <br><select name="sel" id="sel" onchange="javascript:doit();"> <br><option selected>请选择</option> <br><option value="0">不要输入框</option> <br><option value="1">输入框1</option> <br><option value="2">输入框2</option> <br></select> <br><br><input value="输入框1" type="text" name="a1" id="a1" style="display:none;"> <br><input value="输入框2" type="text" name="a2" id="a2" style="display:none;"> <br><br> <br><br> <br> <br> <br> </div>