Related: JavaScript KeyCode vs CharCode
Here is some code you can try at home or in a jsfiddle:
el.addEventListener( \'keyup\', function( e ) {
There is a good article on quirksmode.org answering exactly that question. You might also want to look at Unixpapa's results.