Quiz: Handling Events
Try this self-check quiz to test your knowledge!
What can we attach to DOM elements in order to respond to events in the system?
What method do we use to create an event listener?
element.makeEventListener()
element.listen()
element.on()
element.addEventListener()
element.addEventListener()
is the preferred method for creating a new event listener.The following example uses what type of function to handle an event? element.addEventListener('click', function(event){});
What property on the event
object contains the DOM object that invoked the event?
event.element
event.source
event.target
event.invoker
event.target
property is a reference to the DOM object that invoked the event.Why is the event.preventDefault()
command used?
event.preventDefault()
command prevents the execution of default actions in response to an event trigger or signal.Which event trigger indicates the DOM has finished loading and processing?
DOMContentLoaded
DOMReady
DOMFinished
DocumentReady
DOMContentLoaded
event is dispatched when the HTML has been downloaded and the DOM has been processed.Visit Quiz Online
The quiz on this page has been removed from your PDF or ebook format. You may take the quiz by visiting this book online.