How to get the keypress value from an event object in jQuery
<p>I want to disable users from entering a character into a HTML text input field that isnt a letter or number.</p>

<p>This exact functionality can be seen on the Twitter signup page (username field) https://twitter.com/signup.</p>

<p>Im trying to write this in jQuery. But i need to be able to grab the incomming keypress event value to test which key was pressed and if its value is acceptable.</p>

<p>Here's the code:</p>

<pre><code>&lt;input type="text" id="username" name="username" /&gt;

&lt;script type="text/javascript"&gt;
$("#username").keypress(function(event){   

 // Get the keypress value
 // ...?

// If the keypress value is illegal then disable it
if (...){
   event.preventDefault();
}

});
&lt;/script&gt;
</code></pre>
