When you hover the mouse pointer, an object appears, while moving the mouse pointer, the object is deleted. I used the off function so that when pressed, the object was not deleted when the mouse was moved away. How to make the object retire when it is clicked back and work as before? https://jsfiddle.net/zb9q7e8b/2/
$('h2').next().hide(); $('h2').mouseover(function() { var $anse = $(this).next(); $anse.show(); }); $('h2').mouseout(function() { var $anse = $(this).next(); $anse.hide(); }); $('h2').click(function() { var $anse = $(this).next(); $(this).off('mouseout'); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <h2>123</h2> <div>333</div> <h2>123</h2> <div>333</div> <h2>123</h2> <div>333</div>