Reminder Altered scedule on Wednesday for the AMC12.
Solutions to Practice Practical
Capturing and Bubbling
You have used the familiar addEventListener
apparatus.
It has two arguments, the first is an event type such
as click
or mousemove
. The second is a
function that is called when that event occurs.
There is a third, opional arguement known as
useCapture
, which we will look at today.
When an element detects an event, that event propagates
through the parent events all the way to
body
, html
, and document
.
This upward propagation is called bubbling
. Once this occurs,
the process reverses in a stage known as capturing
.