/ Published in: HTML
This code helps in determining the keycode of any key pressed on the keyboard.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<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>