JSFiddle - React, Tailwind, and code Playground

HTML

<div id="content">
	<button id="remove-1" class="remove">Remove 1</button>
	<button id="remove-2" class="remove">Remove 2</button>
</div>

JavaScript

$(document).ready(function(){
		
	function customCallbackEvent(){
		
		alert('Here is your callback event handler');
				
	}
		
	$('.remove').click(function(){
		
		$(this).remove();
			
		$.when($(this).remove()).then(customCallbackEvent());
			
	});

});