怎么用JavaScript获取DropDownList选中得值,再添加到listbox中

怎么用JavaScript获取DropDownList选中得值,再添加到listbox中   

 var   select1   =   document.all.<%=   yourDropDownList.ClientID   %>;  
  var   select1value   =   select1.options[select1.selectedIndex].value;  
  var   select1Text   =   select1.options[select1.selectedIndex].innerText;  
  var   select2   =   document.all.<%=   yourListBox.ClientID   %>;  
  var   oOption   =   document.createElement("OPTION");  
  select2.options.add(oOption);  
  oOption.innerText   =   select1Text    
  oOption.Value   =   select1value   ; 

posted @ 2009-09-23 20:46  书奎  阅读(501)  评论(0编辑  收藏  举报