JSFiddle - React, Tailwind, and code Playground
HTML
<div class="slide-caption"> <span class="details">Details[+]</span>
<span class="details-display">The connecting walkway floats above the second story of the Main hall, joining the North and the South wings.</span>
</div>
CSS
.details-display {
display: none;
}
JavaScript
var toggled = true;
$('span.details').click(function () {
if (toggled) {
$(this).html('Details[-]');
} else {
$(this).html('Details[+]');
}
toggled = !toggled;
$(this).parent().find("span.details-display").slideToggle("slow");
});