How to remove user input from a text input box with Jquery on submit?
<p>I can't seem to get this to work for the life of me. I've tried setting the value to <code>''</code> with <code>getElementById('guess').value</code> and <code>$('#guess').val</code>, tried using <code>$('#formGuess').reset()</code>, etc. Don't know why the value won't clear out. </p>

<p>Here is my code on this:</p>

<p>js</p>

<pre><code>$('#submit').on('click', function(e) {
  e.preventDefault();

  var guess = $('#guess').val();
  $('#guess').removeAttr('value');
}
</code></pre>

<p>HTML</p>

<pre><code>&lt;div class="container center"&gt;
      &lt;div class="row"&gt;
        &lt;div class="col-md-4 col-md-offset-4"&gt;
          &lt;form class="form-horizontal" method="post" id="guessForm"&gt;
            &lt;div class="form-group"&gt;
              &lt;div&gt;
                &lt;input type="text" class="form-control" placeholder="Guess" id="guess"/&gt;
              &lt;/div&gt;
                &lt;input type="submit" class="btn btn-success" name="submit" value="Guess" id="submit"/&gt;
            &lt;/div&gt;
          &lt;/form&gt;
        &lt;/div&gt;
      &lt;/div&gt;
</code></pre>