
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 −
Example
<!DOCTYPE html> <html> <body> <h2>Heading Two</h2> <a onmouseover="document.body.style.backgroundColor ='orange'">Hover over me to change the background color.</a><br> </body> </html>
Output
Now hover over the text to change the background color of the web page −
Advertisements