Hi
So many time we will get scenario to get Id and value of dropdownlist using Javascript in asp.net. We can get like this
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"> <script type="text/javascript"> function CountrySelect() { var dll = document.getElementById('<%=ddlCountry.ClientID %>'); //For getting Text value of dropdownlist var mod = dll.options[dll.selectedIndex].text; //For getting Value of dropdownlist var mod1 = dll.options[dll.selectedIndex].value; alert(mod1); } </script> </asp:Content> <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> Country Name: <asp:DropDownList ID="ddlCountry" runat="server"> <asp:ListItem Value="0">Select</asp:ListItem> <asp:ListItem Value="1">Nepal</asp:ListItem> <asp:ListItem Value="2">India</asp:ListItem> </asp:DropDownList> <br /> <asp:Button ID="Button1" runat="server" OnClientClick="CountrySelect();" Text="Submit" /> </asp:Content>