dome-event-delagation Flashcards
1
Q
What is the event.target?
A
them specific element where the event occurred
2
Q
Why is it possible to listen for events on one element that actually happen its descendent elements?
A
event bubbling
3
Q
What DOM element property tells you what type of element it is?
A
tag name
4
Q
What does the element.closest() method take as its argument and what does it return?
A
takes an identifier and returns itself or the closest ancestor or null if nothing is identified
5
Q
How can you remove an element from the DOM?
A
remove()
6
Q
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?
A
add it to their parent element