JSFiddle - React, Tailwind, and code Playground

HTML

<div class="layer">
    <a target="blank" href="http://stackoverflow.com">link</a>
<div>

CSS

.layer {
    background:grey;
    width:200px; height:100px;
}

JavaScript

$('.layer a').click(function(){
    return false;
});
    
$('.layer').click(function(){
    alert('clicked');
});