const button = document.getElementById('yourButton'); button.addEventListener('click', (event) => { // Do something with the event // https://developer.mozilla.org/en-US/docs/Web/API/Event })