I most likely just made a stupid error somewhere, but i cant find it...
document.onKeydown = keyHit();
key = window.event.keyCode;
document.write("You pressed Keycode " + key + "<BR><BR>");
might someone tell me what is wrong with it? i run internet explorer
December 24th, 2003, 05:28 PM
Okay, first of all you need to put the onKeyDown event in your body tags IIRC (it's always worked this way for me anyway). Next, if you use document.write, it'll only work once (or at least that's what happened when I tried it) so you could consider using the alert() function instead. Anyway, here's the code I hacked together: