JavaScript Questions & Answers – Mouse Events

This set of Javascript Multiple Choice Questions & Answers (MCQs) focuses on “Mouse Events”.

1. The events that are not triggered directly by user activity are called ___________
a) Device-independent input events
b) Device-dependent input events
c) User interface events
d) State change events
View Answer

Answer: d
Explanation: Some events are not triggered directly by user activity, but by network or browser activity, and indicate some kind of lifecycle or state-related change. The load event, fired on the Window object when the document is fully loaded, is probably the most commonly used of these events.

2. The video and the audio belong to the _________
a) Timers and error handlers
b) API-Specific events
c) State change events
d) User interface events
View Answer

Answer: b
Explanation: The HTML5 video and audio elements define a long list of associated event types such as “waiting”, “playing”, “seeking”, “volumechange”, and so on. These events are usually only of interest to web apps that want to define custom controls for video or audio playback.

3. The client-side JavaScript asynchronous programming model contains _________
a) Timers and error handlers
b) User interface events
c) State change events
d) API-specific events
View Answer

Answer: a
Explanation: Timers and error handlers are part of client-side JavaScript asynchronous programming model and are similar to events.
advertisement
advertisement

4. Which are the events that have default actions that can be canceled by event handlers?
a) Submit and form-related events
b) Reset and form-related events
c) Submit and reset events
d) form-related events
View Answer

Answer: c
Explanation: The submit and reset events have default actions that can be canceled by event handlers, and some click events do, too. The focus and blur events do not bubble, but all the other form events do.

5. The events that represent occurrences related to the browser window are _________
a) Window
b) Element
c) Display
d) Handlers
View Answer

Answer: a
Explanation: Window events represent occurrences related to the browser window itself, rather than any specific document content displayed inside the window.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. Which event is fired when a document and all of its external resources are fully loaded and displayed to the user?
a) Window
b) Load
c) Element
d) Handler
View Answer

Answer: b
Explanation: The load event is the most important of these events: it is fired when a document and all of its external resources (such as images) are fully loaded and displayed to the user.

7. Which is the alternative to the load event?
a) readychange
b) changestate
c) readystatechange
d) contentloader
View Answer

Answer: c
Explanation: DOMContentLoaded and readystatechange are alternatives to the load event: they are triggered sooner, when the document and its elements are ready to manipulate, but before external resources are fully loaded.
advertisement

8. Which is the opposite of the load event in JavaScript?
a) dontload
b) postload
c) preload
d) unload
View Answer

Answer: d
Explanation: The unload event is the opposite of load: it is triggered when the user is navigating away from a document. An unload event handler might be used to save the user’s state, but it cannot be used to cancel navigation.

9. Which is the property that is triggered in response to JavaScript errors?
a) onexception
b) onmessage
c) onerror
d) onclick
View Answer

Answer: c
Explanation: The onerror property of the Window object is something like an event handler, and it is triggered in response to JavaScript errors. It isn’t a true event handler, however, because it is invoked with different arguments.
advertisement

10. Which event can be fired on any scrollable document element?
a) Window
b) Scroll
c) Load
d) Unload
View Answer

Answer: b
Explanation: Scroll events can also be fired on any scrollable document element, such as those with the CSS overflow property set.

Sanfoundry Global Education & Learning Series – Javascript Programming.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.