December 2019
Beginner
464 pages
10h 31m
English
In This Chapter
• Learn how events travel through the DOM
• Understand the differences between event capturing and event bubbling
• Interrupt events
In the previous chapter, you learned how to use the addEventListener function to listen for events that you want to react to. That chapter covered the basics, but it glossed over an important detail about how events actually get fired. An event isn’t an isolated disturbance. Like a butterfly flapping its wings, an earthquake, a meteor strike, or a Godzilla visit, many events ripple and affect a bunch of elements that lie in their path.
In this article, I will put on my investigative glasses, a top hat, and a serious British accent to explain what exactly happens ...