<script type="text/javascript" language="JavaScript"> function show_key_value() { alert("The key code = " + event.keyCode); } </script> Press a key in the textbox: <BR> <input type="text" id="Keyboard" maxlength=4 onkeyup='show_key_value()' />