JS获取DropDownList的value值与text值的示例代码
2018-10-12 13:55
916 查看
相关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获取select选中的option的text示例代码
- JS获取下拉列表所选中的TEXT和Value的实现代码
- js获取dropdownlist的text/value
- JS,Jquery获取select,dropdownlist,checkbox下拉列表框的值(示例代码)
- JS获取DropDownList的value与text值
- 可编辑的下拉框,以及js获取DropDownList的Text和Value
- js 获取asp 控件DropDownList的选择值,及所有的text和value
- JS,Jquery获取select,dropdownlist,checkbox下拉列表框的值(示例代码)
- JS获取DropDownList的value值与text值.txt
- JS获取下拉列表所选中的TEXT和Value的实现代码
- js获取select选中的option的text示例代码
- JavaScript获取dropdownlist的text/value
- JS获取select-option-text_value的方法
- JS获取URL参数代码示例