How to send clientid of asp.net control via JavaScript
<p>I am trying to send the control id on button click in my following asp.net code:</p>

<pre><code>  &lt;asp:TextBox ID="empid" runat="server" CssClass="input_box" onFocus="if (this.value == this.title) this.value='';" onBlur="if (this.value == '')this.value = this.title;" value="Enter employee ID" title="Enter employee ID" onClick="changecol(this)"&gt;&lt;/asp:TextBox&gt;

 &lt;asp:Button ID="abc" runat="server" Text="xxx" 
        CssClass="submit_button" onclick="abc_Click" OnClientClick="return checkEmpid('&lt;%=empid.ClientID%&gt;')"/&gt;
</code></pre>

<p>and Javascript is:</p>

<pre><code>function checkEmpid(id){
var idValue = document.getElementById(id).value;
alert(idValue);
return false;
}
</code></pre>

<p>In alert I am getting null while when I use following code:</p>

<pre><code>&lt;asp:TextBox ID="empid" runat="server" CssClass="input_box" onFocus="if (this.value == this.title) this.value='';" onBlur="if (this.value == '')this.value = this.title;" value="Enter employee ID" title="Enter employee ID" onClick="changecol(this)"&gt;&lt;/asp:TextBox&gt;

 &lt;asp:Button ID="abc" runat="server" Text="xxx" 
        CssClass="submit_button" onclick="abc_Click" OnClientClick="return checkEmpid()"/&gt;

function checkEmpid(){
var idValue = document.getElementById('&lt;%=empid.ClientID%&gt;').value;
alert(idValue);
return false;
}
</code></pre>

<p>In alert I got value entered in text box. Please help me in solving this problem I want to send clientid of control as parameter for JS.</p>

<p>Thanks in advance.</p>
