Posted in Javascript onJanuary 07, 2014
相关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值的示例代码
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@