Execute a script when a mouse pointer moves out of an element in HTML?

HTMLWeb DevelopmentFront End Technology

When the mouse pointer moves out of an element, the onmouseout attribute triggers. You can try the following code to implement onmouseout attribute −


<!DOCTYPE html>
      <h3 id = "myid" onmouseout = "mouseOut()">
         This is demo heading.
      <p>Click above and then release.</p>

         function mouseOut() {
            document.getElementById("myid").style.color = "red";

Updated on 03-Mar-2020 07:29:53