document.addEventListener('keydown', function(e) { document.getElementsByTagName('button')[0].click(); });