Q. When is the mouseover event fired?

  • (A) When mouse is moved over a new element
  • (B) When mouse is clicked
  • (C) When mouse is both moved and clicked
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (A) When mouse is moved over a new element
Explanation: When the user moves the mouse so that it goes over a new element, the browser fires a mouseover event on that element.

Q. When is the mouseout event fired?

  • (A) When mouse is no longer over an element
  • (B) When mouse is over an element
  • (C) When mouse is hovered
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (A) When mouse is no longer over an element
Explanation: When the mouse moves so that it is no longer over an element, the browser fires a mouseout event on that element.

Q. The focus and blur events are also part of

  • (A) Element events
  • (B) Handler events
  • (C) Window events
  • (D) Scroll events
πŸ’¬ Discuss
βœ… Correct Answer: (C) Window events
Explanation: The focus and blur events are also used as Window events: they are triggered on a window when that browser window receives or loses keyboard focus from the operating system.

Q. The element that can also register handlers for load and error events is

  • (A) html
  • (B) img
  • (C) body
  • (D) form
πŸ’¬ Discuss
βœ… Correct Answer: (B) img
Explanation: Individual document elements, such as img elements, can also register handlers for load and error events.

Q. The events that is emulated by the jQuery library are

  • (A) focusarea and focusover
  • (B) focusall and focusnone
  • (C) focusdown and focusup
  • (D) focusin and focusout
πŸ’¬ Discuss
βœ… Correct Answer: (B) focusall and focusnone
Explanation: The jQuery library emulates focusin and focusout events for browsers that do not support them.

Q. Which event is triggered sooner when the document and its elements are ready to manipulate?

  • (A) DOMContentLoaded
  • (B) readystatechange
  • (C) Both DOMContentLoaded & readystatechange
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (C) Both DOMContentLoaded & 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. 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
πŸ’¬ Discuss
βœ… Correct Answer: (D) State change events
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.

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

Q. The client-side JavaScript’s asynchronous programming model contains

  • (A) Timers and error handlers
  • (B) User interface events
  • (C) State change events
  • (D) API-specific events
πŸ’¬ Discuss
βœ… Correct Answer: (A) Timers and error handlers
Explanation: Timers and error handlers are part of client-side JavaScript’s asynchronous programming model and are similar to events.

Q. 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) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (C) Submit and reset events
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.