jQuery mouseleave() Method - CodingTag

jQuery mouseleave()

0 969

  • This jQuery function is worked when the mouseleave event occurs or it binds a function to run when a mouseleave event occurs.
  • A mouseleave event happens when a mouse pointer left the selected element.
  • Most of the time this method is used together with mouseenter() method.

Related Topic:

jQuery keyup
jQuery keypress

jQuery mouseleave()


$(selector). mouseleave();


If you want to trigger a function in it, the syntax will be:

$(selector). mouseleave(function);

Parameter description:

  • function: It represents the function to run when the mouseleave event is triggered. It is optional.


<title> jQuery Example </title>
<script type = "text/javascript"
i = 0;

$("body").css("background", "pink");
$(this).css("background", "yellow");
$(this).css("font-size", "20px");

$("body").css("background", "blue");
$(this).css("background", "pink");
$(this).css("font-size", "16px");


<h2> jQuery Mouseleave event Example </h2>
<p> When you enter the mouse, the color will change. and when you leave it will also change. </p>


When you enter the mouse,

When you leave the mouse,

Best WordPress Hosting


Discount Coupons

Get a .COM for just $6.98

Secure Domain for a Mini Price

Leave a Reply

    Waiting for your comments