title: Set asp.net textbox value using javascript
body: <p>I want to set the value of a asp.net textbox using javascript</p>
  
  <p>My JS Code is:</p>
  
  <pre><code>document.getElementById('&lt;%=txtFlag.ClientID %&gt;').value = "Track";
  </code></pre>
  
  <p>My  textbox is:</p>
  
  <pre><code>&lt;asp:TextBox ID="txtFlag" runat="server" Visible="False"&gt;&lt;/asp:TextBox&gt;
  </code></pre>
  
  <p>But it gives me an error <code>document.getElementById(...)' is null or not an object</code></p>
  
  <p>I dont understand what is wrong.</p>
  
  <p>Please help.</p>