JSFiddle - React, Tailwind, and code Playground

HTML

<div id="all">
    <div id="test">
        <a href="http://google.de">google</a>
    </div>
</div>

CSS

#test { cursor:pointer; padding:10px; width:200px; height:50px; background-color:#ccc; }

JavaScript

$(document).ready(function()
{
    $('#all').delegate("a", "click", function(e)
    {
     alert("fff");
        e.stopImmediatePropagation();
        e.preventDefault();
        $('body').append(e.target.href);
    });  
    
    $('#all').delegate('#test', 'click' ,function() {
        alert('only when i click on the div');
    });

});