Exam4Training

Which two events must you program for?

You are creating a dynamic HTML page by using JavaScript.

Your page has an image of the sun. When the user’s mouse pointer moves across the image of the sun, the image should change to the image of the moon. When the user’s mouse pointer is no longer over the image should change back to the image of the sun.

You need to write the code for the image swap.

Which two events must you program for? (Choose two.)
A . onmouseup
B . onmouseout
C . onmosedown
D . onmouseover
E . onmouseenter

Answer: B,D

Explanation: https://www.w3schools.com/jsref/dom_obj_event.asp

Exit mobile version