Home / Javascript Tips Generated By ChatGPT / Understanding Event Delegation in the DOM in Javascript Handle events more efficiently by taking advantage of event bubbling. Source Code document.addEventListener('click', event => { if (event.target.matches('.myButton')) { console.log('Button clicked'); } });