Event Delegation Flashcards
What is the event.target?
The target property returns the element where the event occured.
Why is it possible to listen for events on one element that actually happen its descendent elements?
Event Flow - bubbling
What DOM element property tells you what type of element it is?
target
What does the element.closest() method take as its argument and what does it return?
A specified CSS selector and returns the nearest ancestor.
How can you remove an element from the DOM?
remove method [element.remove( )]
If you wanted to insert new clickable DOM elements into the page using JavaScript, how could you avoid adding an event listener to every new element individually?
Adding it to the parent element.