- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Execute a script as long as the mouse pointer is moving over an element in HTML?
When the mouse pointer is moving over an element, the onmousemove attribute triggers. You can try to the following code to implement onmousemove attribute −
Example
<!DOCTYPE html> <html> <body> <h3 id = "myid" onmousemove = "mouseMove()"> This is demo heading. </h3> <p>Click above and then release.</p> <script> function mouseMove() { document.getElementById("myid").style.color = "red"; } </script> </body> </html>
Advertisements