Uncaught TypeError: Cannot read property 'addEventListener' of null


#1

function addKeyPressHandler() {
‘use strict’;
document.body.addEventListener(‘keyup’, function(event) {
event.preventDefault();
console.log(event.keyCode);
if (event.keyCode === ESC_KEY) {
hideDetails();
}
});
}

I’m not sure why I’m receiving this error I also have to manually type initalizeEvents(); in the console to get my functions running. Any help would greatly be appreciated!