Document Object Model And Event Handling - Study Mode

[#81] How to detect and respond to mouse drags?
Correct Answer

(C) Registering a mousedown handler

Explanation

Solution: By registering a mousedown handler that registers a mousemove handler, you can detect and respond to mouse drags. Doing this properly involves being able to capture mouse events so that you continue to receive mousemove events even when the mouse has moved out of the element it started in.

[#82] When is the mouseover event fired?
Correct Answer

(A) When mouse is moved over a new element

Explanation

Solution: When the user moves the mouse so that it goes over a new element, the browser fires a mouseover event on that element.

[#83] When is the mouseout event fired?
Correct Answer

(A) When mouse is no longer over an element

Explanation

Solution: When the mouse moves so that it is no longer over an element, the browser fires a mouseout event on that element.

[#84] The focus and blur events are also part of
Correct Answer

(C) Window events

Explanation

Solution: 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.

[#85] The element that can also register handlers for load and error events is
Correct Answer

(B) img

Explanation

Solution: Individual document elements, such as img elements, can also register handlers for load and error events.