VOOZH about

URL: https://www.geeksforgeeks.org/html/html-dom-onmousemove-event/

⇱ HTML DOM onmousemove Event - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML DOM onmousemove Event

Last Updated : 15 Jun, 2023

The DOM onmousemove event in HTML occurs when the pointer is moved over an element.

Supported Tags: It supports All HTML elements, EXCEPT:

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

Syntax: 

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

Example: Using the addEventListener() method 

Output: 

👁 Image
 

Supported Browsers: The browsers supported by DOM onmousemove event are listed below: 

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera
Comment