Q. The events that represents occurrences related to the browser window are

  • (A) Window
  • (B) Element
  • (C) Display
  • (D) Handlers
πŸ’¬ Discuss
βœ… Correct Answer: (A) Window
Explanation: Window events represent occurrences related to the browser window itself, rather than any specific document content displayed inside the window.

Q. 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
πŸ’¬ Discuss
βœ… Correct Answer: (B) Load
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.

Q. Which is the alternative to the load event?

  • (A) readychange
  • (B) changestate
  • (C) readystatechange
  • (D) contentloader
πŸ’¬ Discuss
βœ… Correct Answer: (C) readystatechange
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.

Q. Which is the opposite to the load event in JavaScript?

  • (A) dontload
  • (B) postload
  • (C) preload
  • (D) unload
πŸ’¬ Discuss
βœ… Correct Answer: (D) unload
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.

Q. Which is the property that is triggered in response to JavaScript errors?

  • (A) onexception
  • (B) onmessage
  • (C) onerror
  • (D) none of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (C) onerror
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.

Q. Which event can be fired on any scrollable document element?

  • (A) Window
  • (B) Scroll
  • (C) Load
  • (D) Unload
πŸ’¬ Discuss
βœ… Correct Answer: (B) Scroll
Explanation: Scroll events can also be fired on any scrollable document element, such as those with the CSS overflow property set.

Q. The type that specifies what kind of event occured is

  • (A) event type
  • (B) even target
  • (C) both event type and even target
  • (D) none of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (A) event type
Explanation: The event type is a string that specifies what kind of event occurred) The type “mousemove”, for example, means that the user moved the mouse.

Q. Which is the object on which the event occured or with which the event is associated?

  • (A) event type
  • (B) event target
  • (C) both event type and even target
  • (D) none of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (B) event target
Explanation: The event target is the object on which the event occurred or with which the event is associated. When we speak of an event, we must specify both the type and the target.

Q. In general, event handler is nothing but

  • (A) function
  • (B) interface
  • (C) event
  • (D) handler
πŸ’¬ Discuss
βœ… Correct Answer: (A) function
Explanation: An event handler is in general, a function that handles or responds to an event.

Q. When will the browser invoke the handler?

  • (A) Program begins
  • (B) Any event occurs
  • (C) Specified event occurs
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (C) Specified event occurs
Explanation: When an event of the specified type occurs on the specified target, the browser invokes the handler.