您的位置:首页 > Web前端 > JavaScript

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

2009-09-23 20:46 513 查看
怎么用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 ;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: