javascript怎样取dropdownlist的值? var tb=document.getElementById("DropDownList1").value; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 document.getElementById("ddUser").options[document.getElementById("ddUser").selectedIndex].value仅供参考 去不出来啊!var tb=document.getElementById("DropDownList1").value; function Button2_onclick() {function Button1_onclick() {var y=document.getElementById("DropDownList1").options[document.getElementById("DropDownList1").selectedIndex].valuewindow.alert(y);}</script> <asp:DropDownList ID="DropDownList1" runat="server" Height="22px" Width="79px"> </asp:DropDownList><input id="Button1" type="button" value="button" language="javascript" onclick="return Button1_onclick()" />老师提示错误.!不知道为什么? <input id="Button1" type="button" value="button" language="javascript" onclick="return Button1_onclick()" />是不是这里有问题,lz getElementById要看HTML页面的id为准 这个是对的:document.getElementById("DropDownList1").options[document.getElementById("DropDownList1").selectedIndex].value var _index = document.getElementById("DropDownList1").selectedIndexvar _value = document.getElementById("DropDownList1").options[_index].valuevar _text = document.getElementById("DropDownList1").options[_index].text可以得到, 列表任意项的值, 和显示文本 Form表单无法过滤HTML标记 提示有潜在危险 sqlserver 联合查询,统计 用vs03 导出数据到excel 条件查询,为什么点击下一页的时候,又全部都出来了! Web2.0到底是什么 可不可以告诉我这个该这么做〉????? 给点思路!!! 朗新天霁的.net面试题 发布到线上服务器的网站,访问时在域名后面多出一长串字符 一个奇怪的问题! 网上有ASP。NET的书可以推荐给我吗? 求教:session变量有效期的问题 我新建一个asp.net工程,然后在.aspx上拖拉几个按钮控件,运行,单击按钮,发现每次单击一个按钮时候,整个页面似乎都要重新加载,导致看
function Button1_onclick() {
var y=document.getElementById("DropDownList1").options[document.getElementById("DropDownList1").selectedIndex].value
window.alert(y);
}</script> <asp:DropDownList ID="DropDownList1" runat="server" Height="22px" Width="79px">
</asp:DropDownList><input id="Button1" type="button" value="button" language="javascript" onclick="return Button1_onclick()" />老师提示错误.!不知道为什么?
var _value = document.getElementById("DropDownList1").options[_index].value
var _text = document.getElementById("DropDownList1").options[_index].text可以得到, 列表任意项的值, 和显示文本