Answer the following questions to gauge your understanding of events:
- Which of these is the second phase of the event life cycle?
- Capturing
- Targeting
- Bubbling
- The event object provides us with which of the following? – Select all that apply:
- The type of event triggered
- The target DOM node, if applicable
- The mouse coordinates, if applicable
- The parent DOM node, if applicable
Look at this code:
container.addEventListener('click', (e) => {
if (e.target.className === 'box') {
document.querySelector('#color').innerHTML =
e.target.style.backgroundColor
document.querySelector('#message').innerHTML = e.target.innerHTML
messageBox.style.visibility = 'visible'
document.querySelector('#delete').addEventListener('click', (event) => {
messageBox.style.visibility = 'hidden'
e.target.remove()
})
}
})
- Which JavaScript features ae used in the preceding code? Select...