JSFiddle - React, Tailwind, and code Playground

by kunal singh

HTML

<div id="clickme">
			<a class="req_pic_link" id="hideshow1">CLICK ME</a>
   </div>
  
  <div id="req">
		<iframe id="frame" src="https://www.google.com"></iframe>
		</div>

CSS

#req_frnd
{
display:none;
position: absolute;	
z-index: 1;	
margin-left:50px;
}
#frame{
   width:300;
   height:300;
   border-color:#080000;
   
}

JavaScript

$('#hideshow1').on("click", function() {
    var text = $(this).val();
    $("#req").toggle();

});

$(window).on("click keydown", function(e) {
  //e.preventDefault()
  if (e.keyCode === 27 || !$(e.target).is(function() {return $("#req, #hideshow1")})) {
    $("#req").hide()
  }
}).focus()