本帖最后由 vaneewoo 于 2010-02-04 13:30:51 编辑

解决方案 »

  1.   

    <html>   
      <head>   
      <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">   
      <title>两级连动</title>     <script   defer>   
      var   ar   =     
      [[["A"],["A1","A2","A3]],[["B"],["B1","B2","B3"]]];   
        
      for   (var   i=0;i<ar.length;i++)   
      prov.options[prov.options.length]=new   Option(ar[i][0],ar[i][0])   
        
      function   provChanged(i)   
      {   
      city.innerHTML=""   
      for   (var   j=0;j<ar[i][1].length;j++)   
      city.options[city.options.length]=new   Option(ar[i][1][j],ar[i][1][j])   
      }   
        
      provChanged(0);   
        
      function   show()   
      {   
      alert(prov.value+city.value)   
      }   
      </script>   
      </head>   
      <body>
       
      <select   id=prov   style="width:100"   onchange="provChanged(selectedIndex)"></select>   
      <select   id=city   style="width:100">  </body>   
      </html> 
    应该如何修改呢?