A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/html/html-onmouseover-event-attribute/ below:

HTML onmouseover Event Attribute - GeeksforGeeks

HTML onmouseover Event Attribute

Last Updated : 11 Jul, 2025

The onmouseover event attribute works when the mouse pointer moves over the specified element. It is basically:

Syntax
<element onmouseover = "script">
Attribute value

This attribute contains a single value script that works when the mouse moves over the element. 

Example: In this example, we will see when we hover our mouse over an element we can see an alert popup on our screen.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>onmouseover event attribute</title>
    <style>
        body {
            text-align: center;
        }

        h1 {
            color: green;
        }
    </style>
</head>

<body>
    <h1>
        GeeksforGeeks
    </h1>
    <h2>
        onmouseover Event Attribute
    </h2>
    <p onmouseover="geeks()">
        Computer science portal
    </p>
    <script type="text/javascript">
        function geeks() {
            alert("Mouse move over");
        } 
    </script>
</body>

</html>

Output:

We have a complete list of HTML DOM methods, to check those please go through this HTML DOM Object Complete reference article.

Supported Tags

It supports all HTML elements except <base>  <bdo>  <br>  <head>  <html>  <iframe>  <meta>  <param>  <script>  <style>  <title> tags.

Supported Browser

The browser supported by onmouseover Event Attribute are listed below:

We have a Cheat Sheet on Javascript where we covered all the important topics of Javascript to check those please go through Javascript Cheat Sheet-A Basic guide to JavaScript.



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4