JSFiddle - React, Tailwind, and code Playground
HTML
<div id='black'></div>
<a href='#' id='clck'>Click</a>
<br /><Br />
<img src='http://www.google.ru/images/nav_logo40.png'>
CSS
#black{
position: absolute;
top: 0px; left: 0px; right: 0px; bottom: 0px;
background: #000;
opacity: 0.5;
display: none;
}
#clck{
position: absolute;
z-index:2;
background: white;
padding: 6px;
}
JavaScript
$("#clck").click(function(){
$("#black").toggle();
})