Learn html - html tutorial - Onmouseover attribute in html - html examples - html programs
- The onmouseover attribute triggers when the mouse pointer move over the element.
Syntax for onmouseover attribute in HTML:
<element onmouseover="script">
Applies To:
Element |
Attribute |
All HTML elements |
onmouseover |
Attribute Values:
Value |
Description |
script |
The script can run on onmouseover |
Sample Coding for onmouseover Attribute in HTML:
Tryit<!DOCTYPE html>
<html>
<head>
<title>Wikitechy onmouseover attribute</title>
</head>
<body>
<p onmouseover="mouseOver(this)" onmouseout="mouseOut(this)">
Move mouse pointer to check onmouseover Event.<br>Learn to Code in Wikitechy.
</p>
<script>
function mouseOver (obj)
{
obj.style.color = "red";
}
function mouseOut (obj)
{
obj.style.color = "blue";
}
</script>
</body>
</html>
Code Explanation for onmouseover Attribute in HTML:
- onmouseoverattribute used to trigger an event when the mouse pointer move over to the specified element.
- onmouseout attribute used to trigger an event when the mouse pointer left out from the specified element.
- mouseover JavaScript function used to change the text color to red.
- mouseOut JavaScript function used to change the text color to blue.
Output for onmouseover Attribute in HTML:
- The output shows "Move mouse pointer to check onmouseover Event. Learn to Code in Wikitechy." in default (Black) color.
- Once we move the mouse pointer to over the text the mouseOver() function called and the text color will be changed to red.
- If we move the mouse pointer left out from the text mouseOut function called and the text color will be changed to blue.
Browser Support for onmouseover Attribute in HTML:
Related Searches to onmouseover attribute in html
onmouseover css
html onmouseout
html mouseover image
onmouseover unity
html mouseover text
onmouseover change color
onmouseover react
onmouseover javascript change image
html tutorialshtml editor html code html form html tutorial html color html color codes html table html img html5 html code for website html and css html programs html website free html editor html5 tutorial wysiwyg html editor html tutorial pdf html converter php tutorial html example html tutorial css tutorial html css html tags html basics code html html online html mailto html lang html tags list