What is Event Capturing ?

Event Capturing is also one of the Event Propagation phases. It is also known as Event Trickling. It is the opposite of the event bubbling phase. In event bubbling where the event bubbles out from the target element to its ancestors in the DOM hierarchy, here it will go down through the ancestor to the target element. This downward propagation of the events is known as Event Capturing. You can enable Event Capturing by passing a third parameter as a true value to the addEventListener() method at the time of attaching an event using it.

selectedElement.addEventListener('event', callback, true);

NOTE: By default, the third parameter of the addEventListener() is false which makes it bubble up to the ancestors in the DOM hierarchy


Contact Us