JSFiddle - React, Tailwind, and code Playground

by benhowdle89

HTML

<div class="overlay"><input type="text" id="answer" /><button id="check">SUBMIT</button></div>

CSS

.overlay {
    width:100%;
    height:100%;
    position:fixed;
    background:rgba(0,0,0,0.7);
    color:#fff;
    display: none;
}

JavaScript

$(document).ready(function(){
    $(window).resize(function(){
          $('.overlay').show();   
    });
    
    $('#check').click(function(){
        if($('#answer').val() == 'test'){
             $('.overlay').hide();                
        }   
            
    });
    
});