title: Refresh the value of a jQuery variable
body: <p>I am loading a php page with this ajax call. Works great the first time, but I want to reload (the user can attempt multiple answers). However, on the second load the variable theAnswer retains the value of the first attempt. </p>
  
  <pre><code>$('body').on("click", "#answer-submit", function() {
      var theAnswer = $('#challenge-answer').val();
      //alert(theAnswer);
      $.ajax({    
      type: "POST",
          url: "ajax/answer.php",
          data: { answer : theAnswer },
          dataType: "html",
          success: function(msg){
              if(parseInt(msg)!=0) {
                  $('#answer').html(msg);
              }
          }
      }); 
  });
  </code></pre>
  
  <p>Here is the HTML</p>
  
  <pre><code>&lt;div id=question-form&gt;
      &lt;input type=text name=answer id=challenge-answer class=clue-input /&gt;&lt;br /&gt;
      &lt;button id=answer-submit&gt;GO&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>