Cannot alert value from onkeydown event
<p>Nothing I have found or tried so far has helped or produced anything that worked properly.</p>

<p>Here is an example of one my my dozens of failed attempts:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Keyboard Test&lt;/title&gt;
&lt;script type="text/javascript"&gt;
onkeydown=text
function test() {
var key=String.fromCharCode;
if (key=="a")
alert("Hello!");
}
&lt;/script&gt;
&lt;/head&gt;
&lt;/html&gt;
</code></pre>

<p>Could someone please show me how to attempt this properly and why it works?</p>
