exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 4 question 14 discussion

Actual exam question from Microsoft's 70-480
Question #: 14
Topic #: 4
[All 70-480 Questions]

DRAG DROP -
You develop an HTML5 webpage. You have the following HTML markup:

You need to update the content of the DIV element when the mouse hovers over an image and when the mouse coordinates change.
How should you complete the relevant code? (To answer, drag the appropriate code segment to the correct location or locations in the answer area. Use only code segments that apply.)
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
* addEventLister mousemove
Use the element.addEventListener() method to attach an event handler to a specified element. onmousemove : Fires when the mouse pointer is moving while it is over an element
* The clientX property returns the horizontal coordinate (according to the client area) of the mouse pointer when a mouse event was triggered.
Example:
Output the coordinates of the mouse pointer when an mouse event has occurred: var x = event.clientX; // Get the horizontal coordinate var y = event.clientY; // Get the vertical coordinate var coor = "X coords: " + x + ", Y coords: " + y;
The result of coor could be:

X coords: 142, Y coords: 99 -
Reference: HTML DOM addEventListener() Method; onmousemove Event; MouseEvent clientX Property

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Byron73
Highly Voted 5 years, 5 months ago
mousemove and innerHtml. Whenever the mouse moves, the displayed coordinates in the div change accordingly
upvoted 15 times
Sanfour
4 years, 11 months ago
the event(mousemove) is for image object not for all document objects
upvoted 1 times
...
...
alexcode
Most Recent 4 years, 5 months ago
Mouse over and innerHtml is Correct
upvoted 1 times
Mahmoud1165
4 years, 4 months ago
They said "when the mouse coordinates change" so mousemove and innerHTML is the correct answer
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago