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
- Difference between background and background-color
- How to change an element color based on value of the color picker value using onclick?
- HTML | DOM Style background Property
- HTML | DOM onmouseover event
- HTML | onmouseover Event Attribute
- How to set the SVG background color ?
- HTML | DOM HR color Property
- HTML | DOM Input Color name Property
- HTML | DOM Input Color value Property
- HTML | DOM Style color Property
- Set the opacity only to background color not on the text in CSS
- HTML | DOM Input Color autocomplete 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.