js获取和设置dropdownlist的选定项

来源:百度知道 编辑:UC知道 时间:2024/06/05 06:37:45
如题!js获取dropdownlist服务器控件的选定项(asp.net),比如一个dropdownlist的ID=“DllList”,我用document.getElementById("DllList").value或者document.getElementById("DllList").selectIndex类似的方法都获取不到,请求高人指点?

要用

document.getElementById('<%=DllList.ClientID%>').value

你是要获取下拉框选定项的text值吧,那应该用
document.getElementById("DllList").options[document.getElementById("DllList").selectedIndex].text