Events

Event objects

Preventing default behavior

Event bubbling and capturing


Exercises

  1. Change Example 20.1 by adding another button. What's the benefit of using event object in this example?
  2. When we click on a link, what's the default behavior? How do we prevent default behavior?
  3. What is event bubbling? In an event handler or listener of an element, how do we prevent the event from bubbling up to its parent?