The Wayback Machine - https://web.archive.org/web/20221111031232/https://www.geeksforgeeks.org/html-onmouseout-event-attribute/
Skip to content
Related Articles

Related Articles

HTML | onmouseout Event Attribute

Improve Article
Save Article
  • Difficulty Level : Basic
  • Last Updated : 18 Aug, 2022
Improve Article
Save Article

The onmouseout event attribute works when the mouse pointer moves out of the specified element. 

Syntax:

<element onmouseout = "script">

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

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

Example: This example uses onmouseout event to display an alert message when mouse move out from the paragraph element. 

HTML




<!DOCTYPE html>
<html>
<head>
    <title>
        onmouseout Event Attribute
    </title>
    <script>
        /* Script run when onmouseout
                event call */
        function geeks() {
            alert("Mouse move out");
        }
    </script>
</head>
<body style="text-align:center">
    <h2>
        onmouseout Event Attribute
    </h2>
 
    <!-- onmouseout event call here -->
    <p onmouseout="geeks()">
        Computer science portal
    </p>
 
</body>
</html>

Output:

 Onmouseout even output 

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

  • Google Chrome 1
  • Edge 12
  • Internet Explorer 9
  • Safari 1
  • Firefox 6
  • Opera 12.1
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!