JSFiddle - React, Tailwind, and code Playground
HTML
<div class="a">
You should se me
</div>
<div id="cover"></div>
<script type="text/javascript">
var wrongAnswer=prompt('Write answer here:',"answer")!="answer";
document.getElementById('cover').style.display='none';
if(wrongAnswer){
alert("Wrong answer!!");
document.write('<!--');
}
</script>
<div class="a hide">
If you see me, you have written the right answer!
</div>
<script type="text/javascript">
if(!wrongAnswer){
document.write('<!-- ');
}
</script>
-->
<div class="a">
You should see me too
</div>
CSS
#cover{position:fixed;top:0;left:0;height:100%;width:100%;
background:yellow;/* Set it to the color that you want */
}
/* The following is optional */
.a{width:300px;height300px;border:2px solid blue;margin:5px;}
.hide{background:red;}