JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<div>
<h3>other DIV's</h3>
</div>
<h3>BODY</h3>
<p>disappearing window by clicking</p>
</body>
CSS
div{float:right; width:200px; height:200px; padding:10px;
background-color:#9f7f7f; border:1px solid #69c;}
p{position:absolute; top:60px; left:130px; padding:10px;
width:130px; height:100px; background-color: #27ba24;
border:1px solid #9cf; text-align:center; font-size:15pt}
body{background-color:#ecd9d9;}
JavaScript
$(document).click( function(event){
if( $(event.target).closest("p").length )
return;
$("p").fadeOut("slow");
event.stopPropagation();
});