Use mouseleave
, which "is dispatched when a mouse or another pointing device leaves the physical space given to the element and to all of its descendants":
$(document).ready(function() {
$('#parent').on('mouseleave', function() {
alert('Mouse out!');
});
});