Quiz
Test your knowledge of event handlers in JavaScript by answering the following questions.
Questions
Which of the following is the correct event handler to detect a mouse click on a link?
onMouseUp
onLink
onClick
When does the onLoad event handler for the <body> tag execute?
When an image is finished loading.
When the entire page is finished loading.
When the user attempts to load another page.
Which of the following event object properties indicates which key was pressed for an onKeyPress event in Internet Explorer?
event.which
event.keyCode
event.onKeyPress
Answers
c. The event handler for a mouse click is onClick.
b. The <body> tag's onLoad handler executes when the page and all its images are finished loading.
b. In Internet Explorer, the event.keyCode property stores the character code for each keypress.