I have a div and it's listend by a event handler:
$('.thediv').click(function() {
$(this).remove()
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div style="width:500px;height:500px">
<input type="input" style="width:100px;height:20px" />
</div>
The div would be removed if it's clicked.
However, I want to put a text input box on the div and if the user clicks the text input, the div should not be removed. Only when the user clicks the area outside the input box, the div get removed.
What can I do?