title: Jquery - Display value of user input live
body: <p>Similar to Stack Overflow, I'm trying to create a <code>jquery</code> method that records and displays the value of what a user enters into an <code>&lt;input type='text'&gt;</code> field.</p>
  
  <pre><code>&lt;form&gt;
    Language:&lt;/br&gt;
    &lt;input type="text" language="language"&gt;
    &lt;input type="submit" value="submit"&gt;
  &lt;/form&gt;
  
  &lt;p&gt;
  &lt;/p&gt;
  
  &lt;script&gt;
    $(document).ready(function () {
      $(":text").keypress(function () {
        $("p").text($(":text").val());
      });
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>It accurately records the correct value, but it is one step too slow. If I type in a first character, it doesn't show up, but after I type in a second character, only the first character is recorded. If I type in 3 characters, the first 2 are recorded, etc.</p>
  
  <p>How can I fix this?</p>