JSFiddle - React, Tailwind, and code Playground
HTML
<h2>!</h2>
<button onClick="document.getElementById('pol').style.display='block'">Show</button>
<div id="pol">
I am Tanmoy Biswas
</div>
CSS
h2{margin:0 0 10px}
#pol{
width:400px;
height:300px;
background:#999;
text-align:center;
display:none;
margin-top:0;
margin:10px;
}
JavaScript
window.addEventListener('mouseup',function(event){
var pol = document.getElementById('pol');
if(event.target != pol && event.target.parentNode != pol){
pol.style.display = 'none';
}
});