title: javascript onkeypressed not giving current text box content
body: <p>I have an html form like this:</p>
  
  <pre><code>&lt;form id="boxy" action="layout.html" method="get" accept-charset="utf-8"&gt;
    &lt;input type="text" id="a" onkeypress="Boxy.Check(this);"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Invoking javascript like this:</p>
  
  <pre><code>Boxy.Check = function() {
      input = document.getElementById(this.currentSelector.id).value;
      console.log("\"" + input + "\"");
  };
  </code></pre>
  
  <p>However, <code>this.value</code> is the previous value before <code>onkeypress</code>.</p>
  
  <p>For example, if I just type "A" into the form, <code>console.log()</code> prints "". And if I type "AA", <code>console.log</code> prints "A".</p>
  
  <p>Is there a way to get the current content of the input?</p>