How to attach mouse leave event to an element?

 Posted by Vivek.Ramapuram on 11/7/2014 | Category: jQuery Interview questions | Views: 792 | Points: 40
Answer:

in script coding we have to attach or we have to use mouseleave() method
Example :
<script type="text/javascript">


$("#spanMouseDownUp").mouseleave(function () {
$(this).html("Mouse left this area");
});
</script>
<div id="spanMouseDownUp" style="background:green;color:White;padding:10px;">Try to bring your mouse here</div>


Here when user try to leave the mouse from the “spanMouseDownUp” element then “Mouse left this area” text will be written inside it.


Asked In: spotted while learning | Alert Moderator 

Comments or Responses

Login to post response