JSFiddle - React, Tailwind, and code Playground

by Camilo Escobar

HTML

<center><div class="divspoiler">
<input type="button" value="Mostrar" onclick="if (this.parentNode.nextSibling.childNodes[0].style.display != '') { this.parentNode.nextSibling.childNodes[0].style.display = ''; this.value = 'Ocultar'; } else { this.parentNode.nextSibling.childNodes[0].style.display = 'none'; this.value = 'Mostrar'; }" />
    </div><div><div class="spoiler" style="display: none;">
    <!-- Adentro de este comentario el contenido a ocultar/mostrar -->
<img src='http://www.w3.org/html/logo/downloads/HTML5_Logo_512.png' width='400px'/>
    <!-- Adentro de este comentario el contenido a ocultar/mostrar -->
    </div></div></center>

CSS

/*Opcional */
.divspoiler input{
background: #333; /* Aqui va el color de fondo del boton */
border: none; /* Selecciona none para que no tenga border, o elimina la liena para que tenga borde */
border-radius: 3px; /* Las esquinas redondeadas */
width: 60px; /* El ancho del boton (opcional) */
height: 25px; /* El alto del boton (opcional) */
color: #fff; /* El color del texto */
cursor: pointer; /* Forma del cursor */
font-family: sans-serif; /* Fuente del texto */
font-weight: bold;
}

JavaScript

//No necesita