Understand the two phases of event propagation: bubbling and capturing.
Source Code
// Bubbling phase
document.getElementById('myElement').addEventListener('click', () => {
console.log('Clicked!');
}, false);
Understand the two phases of event propagation: bubbling and capturing.
// Bubbling phase
document.getElementById('myElement').addEventListener('click', () => {
console.log('Clicked!');
}, false);