Event Listeners & Handlers

What is event delegation and why is it useful?
parent.addEventListener('click', function(e) {
  if (e.target.matches('.button')) {
    // Handle button click
  }
});
Next Question (5/20)