Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML | DOM onmouseenter Event

Improve Article
Save Article
  • Last Updated : 04 Aug, 2021
Improve Article
Save Article

The DOM onmouseenter event in HTML occurs when the mouse pointer is moved onto an element. This event is the opposite of onmouseleave event. 
This event is similar to the onmouseover event.
Supported Tags: It supports All HTML elements, EXCEPT: 

  • <base>
  • <bdo>
  •  <br>
  • <head>
  • <html>
  • <iframe>
  • <meta>
  • <param>
  • <script>
  • <style>
  • <title>


  • In HTML: 
<element onmouseenter="myScript">
  • In JavaScript: 
object.onmouseenter = function(){myScript};
  • In JavaScript, using the addEventListener() method: 
object.addEventListener("mouseenter", myScript);

Example: Using the addEventListener() method 


<!DOCTYPE html>
        HTML DOM onmouseenter Event
        <h1 id="demo">GeeksforGeeks</h1>
          "mouseenter", enter);
        function enter() {
              "demo").style.color = "green";


Supported Browsers: The browsers supported by HTML DOM onmouseenter Event are listed below: 

  • Google Chrome 30.0
  • Internet Explorer 5.5
  • Firefox
  • Apple Safari 6.1
  • Opera 11.5


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!