title: Reset textbox value in javascript
body: <p>If I have a input textbox like this:</p>
  
  <pre><code>&lt;input type="text" id="searchField" name="searchField" /&gt;
  </code></pre>
  
  <p>How can I set the value of the textfield using javascript or jQuery?</p>
  
  <p>You would think this was simple but I've tried the following:</p>
  
  <p><strong>Using defaultvalue</strong></p>
  
  <pre><code>var a = document.getElementById("searchField");
  a.value = a.defaultValue;
  </code></pre>
  
  <p><strong>Using jQuery</strong></p>
  
  <pre><code>jQuery("#searchField").focus( function()
  { 
    $(this).val(""); 
  } );
  </code></pre>
  
  <p><strong>Using js</strong></p>
  
  <pre><code>document.getElementById("searchField").value = "";
  </code></pre>
  
  <p>None of them are doing it... :/</p>