JSFiddle - React, Tailwind, and code Playground
by MikeIn
HTML
<div class="Link-Box">
<a href="#" class="S-Btn">Show spoiler Alert</a>
</div>
<br>
<div class="Spoiler-Box">
<h3>
Title
</h3>
<p>
Something Something in the text area.
</p>
</div>
CSS
/*
Coded for help asked here (In general): https://forums.digitalpoint.com/threads/adding-hidden-text-to-a-simple-html-document.2776440/
*/
.Spoiler-Box {
display: none;
width: 50%;
margin: 0 auto;
background: #CCFFFF;
text-align: center;
padding: 6px;
}
.SB-Disp {
display: block !important;
}
.Link-Box {
text-align: center;
}
a,
a:hover,
a:active {
text-decoration: none;
}
JavaScript
$('.S-Btn').on('click', function(e) {
$('.Spoiler-Box').toggleClass("SB-Disp");
});