window.onkeyup=function(e){ var code = e.which ? e.which : e.keyCode; alert( String.fromCharCode(code) ); }