JSFiddle - React, Tailwind, and code Playground

HTML

<div class="lightbox-con">
    <p>test</p>
    <a  hef="#" class="arrow">test arrow</a>
</div>

JavaScript

$('.lightbox-con').click(function(e){ 
  var target = $(e.target);
    if(target.hasClass("arrow")) {
        event.stopPropagation();
    } else {
         $(this).remove();  
    }
});