I'm trying to read a variable named ID="_errors" into my javascript using getElementById, but something about my implementation causes my JS file to be ignored.
This is the HTML:
...
<asp:TextBox ID="_password" CssClass="login" runat="server" TextMode="Password" />
<label class="mylabel" for="<%=_errors.ClientID%>"></label>
<table id="table1">
<tr>
<td style="width: 100px;"></td>
<td><span class="response1" runat="server"><asp:Literal ID="_errors" runat="server" /></span></td>
</tr>
<tr>
<td style="width: 280px;"></td>
<td><asp:Button ID="_login" CssClass="mybutton" runat="server" Text="Login" /></td>
</tr>
</table>
...
This is how I reference _errors in my .js file:
var PassWord = document.getElementById('_login__password').value;
var Errors = document.getElementById('_login__errors').value;
I reference my PassWord value here, because it works just fine. By viewing my page source I use the ClientID to know what the ID for _errors is.I did the same for PassWord. The thing that worries me (and the likely source of the error) is that the portion <asp:Literal ID="_errors" runat="server" /> does not show up in the page source at all. Any clue as to what might be the problem here?