Event Delegation is basically a pattern to handle events efficiently. Instead of adding an event listener to each and every similar element, we can add an event listener to a parent element and call an event on a particular target using the .target property of the event object.
selector = ".buttonClass";
document.getElementById('buttons').addEventListener('click', event => { // Step 2
if (event.target.matches(selector)) {
console.log('Click!');
}
})