This keypress event works fine for me in Chrome and Firefox, but simply isn't being picked up at all in IE7:
$(window).keypress(function(e) {
alert('hello world');
});
Does anyone know alternatives for IE7?
Or is it an error higher up in my JavaScript that means it isn't being picked up in IE7 - in which case, how can I debug it? I have script errors turned on in IE, but nothing is popping up.
IE doesn't support key events on the window
.
Place it on the document
instead.
$(document).keypress(function(e) {
alert('hello world');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With