How can I trap which key is being pressed on a document.
I can get it to display a message when a key has been pressed, but I need to trap just certain keys using Javascript.
Help!!
Printable View
How can I trap which key is being pressed on a document.
I can get it to display a message when a key has been pressed, but I need to trap just certain keys using Javascript.
Help!!
I'm pretty sure this is IE, not sure about Netscape...
Just hit the key you want to find out the keycode...Code:<script LANGUAGE = "JavaScript">
function showKey(){
alert(event.keyCode);
}
document.onkeypress = showKey;
</script>