How to call a JavaScript function from an onmouseout event?

The onmouseout triggers when you move your mouse out from that element.


You can try to run the following example to learn how to call a JavaScript function from onmouseout event

Live Demo

            function over() {
               document.write ("Mouse Over");
            function out() {
               document.write ("Mouse Out");
      <p>Bring your mouse inside the division to see the result:</p>
      <div onmouseover="over()" onmouseout="out()">
         <h2> This is inside the division </h2>

Updated on: 08-Jan-2020


Kickstart Your Career

Get certified by completing the course

Get Started