Related JS:
Copy code code as follows:
<script type = "text/javascript" language = "javascript">
Function Searchchange ()
{{
var ddl = document.GetelementByid ("DropdownList1")
var index = ddl.selectEx;
var value = ddl.options [index]. Value;
var text = ddl.options [index] .text;
alert (value);
}
</script>
Call:
Copy code code as follows:
<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