In this post, the working of onmouseover event is shown by changing the colours of a paragraph by taking the mouse over a particular colour.
document.bgColor = 'nameOfColor'
HTML code that will change the colour of the background when the mouse is moved over a particular colour. Background colour property specifies the background colour of an element.
Initially, the background colour is white-
When the mouse is moved over the “Bright Green” color-
When the mouse is moved over the “Red” colour-
When the mouse is moved over the “magenta” colour-
When the mouse is moved over the “purple” colour-
When the mouse is moved over the “blue” colour-
When the mouse is moved over the “black” colour-
When the mouse is moved over the “orange” colour-
When the mouse is moved over “yellow” colour-
- CSS | background-color Property
- HTML | DOM Style color Property
- Set the opacity only to background color not on the text in CSS
- HTML | onmouseover Event Attribute
- How to change color of PNG image using CSS?
- Change an HTML5 input placeholder color with CSS
- CSS | background-clip Property
- CSS | background-position Property
- CSS | background-attachment Property
- CSS | background-image Property
- CSS | background-size Property
- CSS | background-repeat Property
- CSS | background-origin property
- CSS | background-blend-mode Property
- CSS | caret-color Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.