HTML:

1 <asp:DropDownList ID="DropdownList1" runat="server" AutoPostBack="true" />

JS:

1 <script type="text/JavaScript">
2 function getvalue(){
3 
4                 var select1 = document.all.<%= DropdownList1.ClientID %>;
5                 var selectvalue = select1.options[select1.selectedIndex].value;
6                 var selectText= select1.options[select1.selectedIndex].text;
7                alert(selectvalue+"  "+selectText);
8 }
9 </script>

 

相关文章: