JSFiddle - React, Tailwind, and code Playground

HTML

<div class="test">test</div>

CSS

.test2 {
    position:fixed;
    background-color:#000000;
    filter:alpha(opacity=60);
    opacity:0.6;
    -moz-opacity:0.6;
    z-index:100;
    top: 0;
    left:0;
    right:0;
    bottom:0;
}

JavaScript

$('.test').click(function () {
        $('body').prepend('<div class="test2"></div>');
    });
    $(document).on('click', '.test2', function () {
        $('.test2').remove();
    });