title: javascript clear asp textbox on html button click
body: <p>I want to clear an asp textbox when click to a button (html).</p>
  
  <p>so basically the JS function is:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function clearTextBox() {
          document.getElementByID('&lt;%=txtFName.ClientID%&gt;').value = "";
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>And an asp.net TextBox</p>
  
  <pre><code>&lt;asp:TextBox ID="txtFName" runat="server" class="form-control" placeholder="First name" AutoCompleteType="Disabled" MaxLength="30" /&gt;
  </code></pre>
  
  <p>And a HTML button</p>
  
  <pre><code>&lt;span class="input-group-btn"&gt;
  &lt;button class="btn default" id="clearButton" type="button" onclick="clearTextBox()"&gt;&lt;i class="fa fa-times"&gt;&lt;/i&gt;&lt;/button&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p>All buttons and other controls are in an asp update-panel (don't know if it makes different)</p>
  
  <p>Nothing happend when I clicked to the HTML clearButton, error on the web console:</p>
  
  <pre><code>Uncaught TypeError: undefined is not a function
  clearTextBox 
  onclick
  </code></pre>