How to attach mouse enter event to an element in jquery ?

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

To attach mouse enter event to a html element, mouseenter() method can be used.

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


code mouse enter shows when user try to enter into the area of “spanMouseDownUp” element then “Mouse entered in this area” will be written inside it.


Asked In: spotted while learning | Alert Moderator 

Comments or Responses

Login to post response