- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 −
- Related Articles
- How to change a button background color using Swift?
- How to change the background color using jQuery?
- How to verify the color and background color of a web element in Selenium?
- Change the background color of a button with CSS
- Usage of background-color property in CSS
- How to add background music to your web page?
- How to animate a change in background color using jQuery on mouseover?
- How to play sound file in a web-page in the background?
- How to change the background color of ListView items on Android using Kotlin?
- How do you animate the change of background color of a view on Android using Kotlin?
- How to change header background color of a table in Java
- How to change the background color of a Treeview in Tkinter?
- How to change the background color of a tkinter Canvas dynamically?
- How to change the background color of a plot created by using plot function in R?
- How to change JFrame background color in Java

Advertisements