I have this html
<div class='parent'> <div class='child'></div> </div>
I want to add mouseover and mouseout events to the parent element, but the problem is that the hover child elemet cursor fires the mouseout event, although it is still inside the parent element. how can I avoid this so that the mouseout event is fired only when the cursor leaves the parent element.
$(body).on('mouseover', '.parent' , function(){ }); $(body).on('mouseout', '.parent' , function(){ });
source share