JSFiddle - React, Tailwind, and code Playground

HTML

<div id="info">Hello</div>

CSS

#info {
    width: 200px;
    height: 200px;
    background: #eee;
}

JavaScript

$(document).click(function(e) {   
    if(e.target.id != 'info') {
        $("#info").hide();   
    } 
});