<select name="sel" id="sel" onchange="shift(this)">
<option value=''>请选择</option>
<option value="1">1</option>
<option value="2">2</option>
</select><br/>
<input type="input" name="i" id="i" style="display:none"/>
<input type="checkbox" name="c" id="c" style="display:none"/><script language="javascript">
<!--
function shift( s )
{
if( s.value == 1 )
{
document.getElementById("i").style.display= "block";
document.getElementById("c").style.display= "none";
return;
}
if( s.value == 2 )
{
document.getElementById("c").style.display= "block";
document.getElementById("i").style.display= "none";
}
else
{
document.getElementById("c").style.display= "none";
document.getElementById("i").style.display= "none";
}
}
//-->
</script>

解决方案 »

  1.   

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function chg(sel)
    {
    if(sel.options.selectedIndex == 0)
    {
    document.all.ipt.style.display = '';
    document.all.chk.style.display = 'none';
    }else
    {

    document.all.ipt.style.display = 'none';
    document.all.chk.style.display = '';
    }
    }
    //-->
    </SCRIPT>
    <select onchange="chg(this)">
    <option/>111111
    <option>2222222</option>
    </select><input id="ipt" type = "text">
    <input type = "checkbox" id = "chk" style="display:none">
      

  2.   

    <html>
    <head>
    <title>无标题文档</title>
    <script language="javascript">
    function pp(obj)
    {               
    obj.style.display=(obj.style.display=="block"?"none":"block");
    }
    </script>
    <script id="clientEventHandlersJS" language="javascript">
    <!--function Select1_onchange() {
    if(document.all("Select1").selectedIndex==1){
    document.all("Text1").style.display="none";
    document.all("Checkbox1").style.display="block";
    }
    else{
    document.all("Checkbox1").style.display="none";
    document.all("Text1").style.display="block";
    }
    }//-->
    </script>
    </head><body>
    <form name ="form1">
    <select name=Select1 id=Select1 onchange="return Select1_onchange()"><OPTION 
      value="" selected>1</OPTION><OPTION value="">2</OPTION></select>
    <INPUT id="Text1" type="text" name="Text1">
    <INPUT 
    id="Checkbox1" type="checkbox" name="Checkbox1">  
    </form>
    </body>
    </html>
      

  3.   

    <select onchange="a(this)">
    <option value=1>1
    <option value=2>2
    </select>
    <input name=m1 style="display:none"><input name=m2 type=checkbox style="display:none">
    <script>
    function a(o)
    {
    m1.style.display="none"
    m2.style.display="none"
    eval('m'+ o.options[o.selectedIndex].value +'.style.display=""')
    }
    </script>