Home > Article > Web Front-end > How to use ONMOUSEOVER and ONMOUSEOUT to change the background color or background image in HTML_html/css_WEB-ITnose
1. Use onmouseout onmouseover to transform between images:
2.onmouseover onmouseout changes the text background color:
onmouseout="style.backgroundColor='#bbb'" bgcolor="#bbb">Text
3..onmouseover onmouseout Change text to background image:
onMouseOut="this.background='2.gif'" background="2.gif">text
2.onmouseover onmouseout Change text background color:
onmouseout="style.backgroundColor='#bbb'" bgcolor="#bbb">Text
3..onmouseover onmouseout Change text to background image:
onMouseOut="this.background='2.gif'" background=" 2.gif">Text
2.onmouseover onmouseout changes the text background color:
onmouseout="style.backgroundColor='#bbb'" bgcolor="#bbb">Text
3..onmouseover onmouseout Change text to background image:
onMouseOut="this.background='2.gif'" background="2.gif">text
2.onmouseover onmouseout Change text Background color:
onmouseout="style.backgroundColor='#bbb '" bgcolor="#bbb">Text
3..onmouseover onmouseout Change text to background image:
onMouseOut="this.background='2.gif'" background="2.gif">text div>