<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script>
function ini(){
B.style.display="block"
C.style.display="none"
}
function chg(obj){
if(obj.selectedIndex==1){
B.style.display="block"
C.style.display="none"
}
else{
B.style.display="none"
C.style.display="block"

}
}
</script>
</head><body onload="ini()">
<input id="C" />
<select id="A" onchange="chg(this)">
<option>A的0</option>
<option>A的1</option>
<option>A的2</option>
<option>A的3</option>
<option>A的4</option>
<option>A的5</option>
<option>A的6</option>
</select>
<select id="B">
<option>B的0</option>
<option>B的1</option>
</select>
</body>
</html>

解决方案 »

  1.   

    哈哈, 抢...<select id='A'>
     <option>索引值 零</option>
     <option>索引值 壹</option>
    </select><select id="B">
    </select><input type="text" id="C"><script type="text/javascript">
    //<![CDATA[
     var A = document.getElementById("A");
     var B = document.getElementById("B");
     var C = document.getElementById("C");
     
     C.style.display = "none";
     
     A.onchange = 
      function()
      {
       switch(this.selectedIndex)
       {
        case 1:
         C.style.display = "none";
         B.style.display = "inline";
         break;
        
        default:
         C.style.display = "inline";
         B.style.display = "none";
         break;
       }
      }
    //]]>
    </script>
      

  2.   

    <select id='A'>
     <option>索引值 零</option>
     <option>索引值 壹</option>
    </select><select id="B">
    </select><input type="text" id="C">
    <script type="text/javascript">
    <!--
    var ge = function(id){return document.getElementById(id);};
    var setDisplay=function(arobj,arstyle){for(var i=0,j=arobj.length;i<j;i++) arobj[i].style.display=arstyle[i];} ;
    setDisplay([ge("C")],["none"]);
    ge("A").onchange = function(){
        var ar = ["","none"];
        if(this.selectedIndex==1) ar.reverse();
        setDisplay([ge("B"),ge("C")],ar);
    }
    //-->
    </script>