title: How to call function from text input key press in javascript?
body: <p>With</p>
  
  <pre><code>&lt;input type="text" onKeyPress="alert(this.value)"&gt;
  </code></pre>
  
  <p>the alert box displays the value in the box, not included the current key depressed.</p>
  
  <p>However, this does not exhibit the same behavior, and I don't know why.</p>
  
  <pre><code>&lt;input type="text" onKeyPress="handleInput(this.value)"&gt;
  
  function handleInput(value){
      alert(value);
  }
  </code></pre>
  
  <p><strong><em>Added This</em></strong>
  <a href="http://jsfiddle.net/abalter/adbbb599/6/" rel="nofollow">http://jsfiddle.net/abalter/adbbb599/6/</a></p>