JavaScript for WordPress Forums Vanilla JavaScript 1.4.6 – Event Propagation – Simple question about .id Reply To: 1.4.6 – Event Propagation – Simple question about .id

#27579
Zac Gordon
Keymaster

That is correct. The third parameter ‘useCapture’ determines whether or not the capturing phase is used.


el.addEventListener( 'click', theFunc, false); // Uses Bubbling
el.addEventListener( 'click', theFunc, true); // Uses Capturing

It’s also helpful to know that if you don’t pass a third parameter is will use false by default and leverage bubbling.

This can be a tricky topic, but hope that helps!!!