HTML onmouseover Attribute

HTML onmouseover Attribute: The HTML onmouseover Attribute is defined as it fires when the mouse pointer moves over an 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>.

HTML onmouseover Attribute

The HTML onmouseover attribute can be applied to all the HTML elements.

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

Syntax: <element onmouseover = “script”>

Browser Support:

The HTML onmouseover attribute is supported by the following browsers:

  • Chrome
  • Firefox
  • Opera
  • Safari
  • Internet Explorer

Example: for <img> element

<!DOCTYPE html> 
  <title>onmouseover Event Attribute</title> 
     body { 
       h1 { 
    <script type="text/javascript" > 
          function freshers() { 
         alert("Mouse move over"); 
    <h2>onmouseover Event Attribute</h2> 
    <p onmouseover ="frehsers()">Computer science portal</p> 


HTML onmouseover attribute