JS获取DropDownList的value值与text值的示例代码
2014-01-07 00:00
627 查看
相关JS:
调用:
<script type="text/javascript" language="javascript"> function SearchChange() { var ddl = document.getElementById("DropDownList1") var index = ddl.selectedIndex; var Value = ddl.options[index].value; var Text = ddl.options[index].text; alert(Value); } </script>
调用:
<asp:DropDownList ID="DropDownList1" runat="server" onchange="SearchChange();"> <asp:ListItem Value="0">111</asp:ListItem> <asp:ListItem Value="1">222</asp:ListItem> <asp:ListItem Value="2">333</asp:ListItem> </asp:DropDownList
相关文章推荐
- JS获取DropDownList的value值与text值的示例代码
- JS获取DropDownList的value值与text值的示例代码
- js获取下拉列表框<option>中的value和text的值示例代码
- js获取下拉列表框<option>中的value和text的值示例代码
- 可编辑的下拉框,以及js获取DropDownList的Text和Value
- JS获取下拉列表所选中的TEXT和Value的实现代码
- JS,Jquery获取select,dropdownlist,checkbox下拉列表框的值(示例代码)
- 可编辑的下拉框,以及js获取DropDownList的Text和Value
- js获取select选中的option的text示例代码
- JS,Jquery获取select,dropdownlist,checkbox下拉列表框的值(示例代码)
- js获取dropdownlist的text/value
- JS获取DropDownList的value值与text值.txt
- JS获取DropDownList的value与text值
- js获取select选中的option的text示例代码
- JS获取下拉列表所选中的TEXT和Value的实现代码
- js 获取asp 控件DropDownList的选择值,及所有的text和value
- Js中获取frames中的元素示例代码
- DropDownList获取value与text
- 通过jQuery来获取DropDownList的Text/Value属性值
- 用js分别获取select的value 和 text 文本