Question 81

Rasleen is adding links to her company website. She wants to change the link colour as soon as the visitor's mouse hoven over the link and wants it should…

Rasleen is adding links to her company website. She wants to change the link colour as soon as the visitor's mouse hoven over the link and wants it should retain the original colour when visitor's mouse moves to any other location away from the link. Which of the following two event handless will be required to write a JavaScript code to achieve the same.
  1. AOnMouseOver and OnMouseExit
  2. BOnMouseOver and OnMouseOut
  3. COnMouseIn and OnMouseOut
  4. DOnMouseIn and OnMouseExit
Show answerHide answer

Correct answer: (B) OnMouseOver and OnMouseOut

Explanation

onmouseover fires when the pointer enters the link, and onmouseout fires when it leaves. There are no OnMouseIn or OnMouseExit events.

From DSSSB TGT Computer Science Practice Set 2

This is question 81 of DSSSB TGT Computer Science Practice Set 2. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.