title: jQuery keypress .val() returns previous value after function runs
body: <p>I have a strange issue that I can't seem to figure out:</p>
  
  <p>This keydown/keypress function only returns the previous value (i.e. first time returns nothing, second time returns first value, third time returns second value, etc...)</p>
  
  <p><a href="http://jsfiddle.net/ZRPfb/" rel="noreferrer">http://jsfiddle.net/ZRPfb/</a></p>
  
  <p>Can someone enlighten me as to why <strong>keydown</strong> and <strong>keypress</strong> dont work, but <strong>keyup</strong> works??</p>
  
  <pre><code> $(".modal-body #rowDownload").unbind().on('keypress',function(){
      var numRows = $(".modal-body #rowDownload").val();
      // var numRows = $(this).val();
      alert(numRows);
  
      if (typeof numRows !== 'number') return;
  
  });
  </code></pre>