JSFiddle - React, Tailwind, and code Playground

HTML

<div id='hello'>hello</div>
<a class="title" href="#">this example</a> is a test

JavaScript

$(function() {
    $('a.title').click(function() {
        var htmlClickBind = function (e) {
            console.log('clicked on html, e.target = ' + e.target);
            console.log(e.target == '');
            if (!$(e.target).is('a') ) {
                console.log('cleared click event');
            }
            else {
                $('html').one('click', htmlClickBind);
            }
        };
    
        $('html').one('click', htmlClickBind);
    });
});