Determining keycode values
To determine the keycode value for a given key on the keyboard, save the following HTML code in a file and open it in an Internet Explorer browser window. The keycode value is displayed for any key pressed in that browser.
<html>
<head>
<script>
document.onkeydown = keydownhandler;
function keydownhandler()
{
document.testform.displayField.value = "Keycode: " + window.event.keyCode;
}
</script>
</head>
<body>
<center>
<form name="testform">
<input type="text" name="displayField" value="Hit any key">
</form>
</center>
</body>
</html>