SyntaxFix
Write A Post
Hire A Developer
Questions
The code is
document.addEventListener('keydown', function(event){ alert(event.keyCode); } );
This return the ascii code of the key. If you need the key representation, use event.key (This will return 'a', 'o', 'Alt'...)