Checking Keyboard or Mouse events are done in a Div
<p>How can I check if a keyboard or mouse event is done inside of a div?</p>

<p>Once I check the onmousemove() event of a div it works but onkeyup, onkeypress etc are not working for the div.</p>

<p>What is the reason for that?</p>

<pre><code>&lt;div onmousemove="alert(1);" onkeypress="alert(2);"&gt;
</code></pre>

<p>Here alert(1) will be displayed but alert(2) is not displayed.</p>
