mouseleave() - is executed when the mouse pointer leaves the HTML element:
Example:
<!DOCTYPE html>
<html>
<head>
<title>jQuery mouseleave() method</title>
</head>
<body>
<p>Hey come here</p>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("p").mouseleave(function() {
$(this).hide();
});
});
</script>
</body>
</html>
you can see output by clicking live demo