Home / Javascript Tips Generated By ChatGPT / Handling Events with JavaScript in Javascript Respond to user actions or browser events. Source Code document.getElementById('myButton').addEventListener('click', () => { console.log('Button clicked'); });