title: Clientid sent to javascript function returns null when using document.getElementById
body: <p>I am trying to pass the clientid of a textbox into a javascript function.  For some reason when i use document.getElementById it returns a null.  Please Help</p>
  
  <pre><code>function incNumber(textId){
  
      var id = textId
  
      var test = document.getElementById(textId);
  
      var c = parseInt(document.getElementById(id).value);
      var res = isNaN(c)
      if (res) {
          c = 0;
      }
      else {
          c++;
      }  
  
      document.getElementById(textId).value = c;
  }
  
  &lt;asp:TextBox ID="pointVal" runat="server"&gt;&lt;/asp:TextBox&gt; 
      &lt;asp:Button runat="server" Text="Increase" ID="inc" OnClientClick="javascript:incNumber('&lt;%= pointVal.ClientID %&gt;'); return false;" /&gt;
  </code></pre>