HTML onmouseout Attribute

HTML onmouseout Attribute: The HTML onmouseout attribute is defined as it fires when the mouse pointer moves out of an element. And the onmouseout attribute is often used together with the onmouseover attribute.

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

HTML onmouseout Attribute

This attribute can be applied to all the HTML elements.

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

Syntax: <element onmouseout=”script”>

Browser Support:

This attribute is supported by the following browsers:

  • Chrome
  • Safari
  • Opera
  • Internet Explorer
  • Firefox

Example: for <img> element

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


HTML onmouseout attribute