JSFiddle - React, Tailwind, and code Playground

HTML

<button>remove</button>
 
<script id="test">
$( "button" ).click(function() {
  $( "#test" ).remove();
  alert("removed " + ($( "#test" ).length == 0));
});
</script>