JavaScript window.onkeydown without jQuery

Content

Bind to window.onkeydown natively without jQuery.

window.onkeydown = function(event) {     if (event.keyCode === 27) {         console.log('escape pressed');     } };