javascript - document.getElementById() returns NULL getting value from DropDownList -


i have code:

<td style="text-align: center;">             <asp:dropdownlist id="ddloprep" runat="server" width="70px">                 <asp:listitem value="1">1</asp:listitem>                 <asp:listitem value="2">2</asp:listitem>                 <asp:listitem value="3">3</asp:listitem>             </asp:dropdownlist>         </td> 

now want show confirmation msg selected value in ddloprep:

<asp:button id="btnrelease" runat="server" text="release" width="130px"           onclientclick="return confirmrelease();" onclick="btnrelease_click" />  <script type="text/javascript">     function confirmrelease() {         var oprep = document.getelementbyid("ddloprep");                     return confirm('are sure want release configuration: oprep: ' + oprep + ' ?');     } </script> 

but i'm getting null @ var oprep = document.getelementbyid("ddloprep");

so not possibility var oprep = document.getelementbyid("ddloprep").value;

it's asp.net, clientid

var oprep = document.getelementbyid("<%= ddloprep.clientid %>"); 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -