title: How do I clear the previous text field value after submitting the form with out refreshing the entire page?
body: <p>I am doing a web application using <strong>javascript</strong> and <strong>html</strong> that has a form containing a text field, button. When I enter a number in that text field and submit by clicking on that button, text areas are generated dynamically. Once my form is submitted some text areas are created but if I am not satisfied with existing text areas then again I enter some value with out refreshing page. But the text field value entered previously prevails showing the new text areas below the existing text areas on the page.</p>
  <p>So, how do I <strong>clear the value with out refreshing the page.</strong></p>
  <pre><code>&lt;div&gt;
      &lt;html&gt;
       &lt;input type=&quot;text&quot; name = &quot;numquest&quot; id =&quot;numquest&quot; value=&quot;&quot; size=&quot;5&quot; style=&quot;&quot; disabled&gt;
       &lt;input type=&quot;button&quot; value=&quot;submit&quot; onclick=&quot;getFields();&quot;&gt;
  &lt;/div&gt;
      &lt;/html&gt;
      
      &lt;javascript&gt;
        var num_q=document.getElementById('numquest').value;
       //code for dynamic creation
      &lt;/javascript&gt;
  </code></pre>