document.addEventListener('keydown', function(e) { document.getElementsByTagName('button')[0].click(); });
document.getElementById('id');
document.addEventListener('keydown', function(e) { document.getElementById('button'); });
document.addEventListener('keydown', function(e) { document.getElementById('button')[0].click(); });
document.getElementById('button');
<button id="button">click</button>