Your Search Results

    Window.onmouseout

    Summary

    An event handler for the mouseout event on the window

    Syntax

    window.onmouseout = funcRef;
    
    • funcRef is a reference to a function.

    Example

    window.onmouseout = doFunc;
    
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8" />
    <title>onmouseout test</title>
    
    <style>
    body { border: 1px solid blue; }
    .my_box { border: 1px solid red; }
    p { border: 1px solid green; }
    </style>
    
    <script>
    window.onmouseout = mouseout;
    
    function mouseout() {
     alert("mouseout event detected!");
    }
    </script>
    
    </head>
    <body>
    <div class="my_box">
    <p>move the mouse pointer away from the element it is on<br />
    to fire the mouseout event.</p>
    </div>
    </body>
    </html>
    

    Notes

    The mouseout event is raised when the mouse leaves the area of the specified element (in this case the window itself).

    Specification

    Not part of specification.

    Document Tags and Contributors

    Contributors to this page: Sheppy, LibreGeekingKid, ethertank, Rappo, Jabez, teoli
    Last updated by: teoli,
    Hide Sidebar