<p>Why does this work:</p>

<pre><code>$(window).keydown(function(event){
    alert(event.keyCode);
});
</code></pre>

<p>but not this:</p>

<pre><code>$('#ajaxSearchText').keydown(function(event){
    alert(event.keyCode);
});
</code></pre>

<p>I'm testing with Firefox 3.
Interestingly, neither of them work in IE7.</p>

Try using
```
```
$('#ajaxSearchText').keyup(function(event){
    alert(event.keyCode);
});
```
```
works for me perfectly. Also check the id of the textarea