title: jQuery getting sum with keypress always one step behind
body: <p>I am trying to create an calculator in which I want add/sum on every key press I make like this:</p>
  
  <pre><code>$('#padd').keypress(function() {
  
      var ypoints = "200";        
      var points = parseInt( $(this).val() );
  
      console.log( "Points: " + (points + parseInt(ypoints)) );
  
  }); 
  </code></pre>
  
  <p>My issue is that it seems like "points" always is one step behind. Lets say that my "ypoints" is 200 and I type in first 1, the console.log says "NaN"? If I then type in a "10" the console.log says "201" while in fact it should say "210"?!? If I then add an "100" in the add field it says "210" but it should say "300". Always one keypress behind?!?</p>
  
  <p>What am I missing here or is this not the correct way to do this?</p>
  
  <p>Any help is appreciated and thanks in advance :-)</p>