Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML | onmouseover Event Attribute

  • Difficulty Level : Basic
  • Last Updated : 13 Dec, 2018

The onmouseover event attribute works when the mouse pointer moves over the specified element.

Syntax:

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

<element onmouseover = "script">

Attribute value: This attribute contains single value script which works when mouse moves over the element.

Supported Tags: This attribute is supported by almost all HTML elements except <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title>.



Example:




<!DOCTYPE html>
<html>
    <head>
        <title>onmouseover Event Attribute</title>
        <style>
            body {
                text-align:center;
            }
            h1 {
                color:green;
            }
        </style>
        <script type="text/javascript" >
            function geeks() {
                alert("Mouse move over");
            
        </script>
    </head>
    <body>
        <h1>GeeksforGeeks</h1>
        <h2>onmouseover Event Attribute</h2>
        <p onmouseover ="geeks()">Computer science portal</p>
    </body>
</html>                    

Output:
mouse move over

Supported Browser: The browser supported by onmouseover Event Attribute are listed below:

  • Google Chrome
  • Internet Explorer
  • Safari
  • Firefox
  • Opera
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!