Can you please tell me how to hide the element ( message
) by clicking on another element ( q-delete-icon
)? Currently this code:
$(function() { $('.q-delete-icon').click(function(){ $('.message').click(function(){ $(this).hide('slow'); }); }); });
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div class='message'> <div class='q-delete-icon' id='2'>close</div> От кого:<a href='#'>Ttt</a> | <br /> 2013-07-23 19:31:44<br /> Сообщение </div>