Change Background color of a web page using onmouseover property

The onmouseover property allows you set a script when the mouse pointer is moved onto an element. To change the background color, use the HTML DOM backgroundColor property.

Let us see an example to implement the onmouseover property and change the background color −


 Live Demo

<!DOCTYPE html>
<h2>Heading Two</h2>
   <a onmouseover=" ='orange'">Hover over me to change the background color.</a><br>


Now hover over the text to change the background color of the web page −