Click this paragraph and then press a keyboard key. In most browsers you get told which key you pressed (as an ASCII code) but in IE you get "undefined".
To make it work in IE change event.which to event.keyCode in the function.
The keyCode variation now works with many other browsers as they have built in the IE way to help with compatibility.