title: Passing a variable into an alert
body: <p>When the correct string, <code>foo</code>, is entered into <code>.guess</code> I am trying to pull the value from <code>.clicks</code> and pass it into an alert. When I load the page with my current code (below) the alert reads <code>Correct! You guessed it in  clicks.</code>. Why is the <code>clicks</code> variable not being passed?</p>
  
  <p>Thanks</p>
  
  <p>jQuery:</p>
  
  <pre><code>$('.guess').keyup(function() { 
      if ($('.guess').val() == "foo") {
          var clicks = $('.clicks').val();
          alert('Correct! You guessed it in ' + clicks + ' clicks.');
          location.reload();
      }
  });
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class="bar"&gt;
      &lt;h2 class="clicks"&gt;0&lt;/h2&gt;
      &lt;input type="text" class="guess" /&gt;
  &lt;/div&gt;
  </code></pre>