【 tulaoshi.com - Web开发 】
                             
                            二个框内值传递.不错的效果 
代码如下:
script type="text/javascript" defer="defer"  
function $(value)  
{  
 return document.getElementById(value);  
}  
function ch(s){  
 var p = new Array(0,1,2);  
 p[0] = '大学';  
 p[1] = '高中';  
 p[2] = '初中';  
 if(s.value=='0'){  
  $('n2').options.length = 0;  
  $('n2').options.add(new Option(p[0],p[0]));  
 }  
 if(s.value=='1'){  
  $('n2').options.length = 0;  
  $('n2').options.add(new Option(p[1],p[1]));  
 }  
 if(s.value=='2'){  
  $('n2').options.length = 0;  
  $('n2').options.add(new Option(p[2],p[2]));  
 }  
}  
/script  
table width="400" border="0" style="text-align:center" cellpadding="0" cellspacing="0"  
  tr  
    td width="119"select name="n1" size="10" id="n1" onchange="ch(this)"  
      option value="0"大学/option  
      option value="1"高中/option  
      option value="2"初中/option  
    /select  
    /td  
    td width="281"select name="n2" size="10" id="n2"option value="a"a/option  
        /select/td  
  /tr  
/table 
  [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]