document.addEventListener("keypress", function(e) { if (e.keyCode === 13) { toggleFullScreen(); } }, false);