JSFiddle - React, Tailwind, and code Playground
HTML
<div id="selector">
<span>Hello World</span>
</div>
CSS
#selector{
width:100px;
height:100px;
border:1px solid #CCC;
}
JavaScript
$(document).ready(function(){
$(document).on('remove','span',function(){
alert(" first object object deleted");
});
setTimeout(function(){
$('#selector').empty();
},3000);
});