Mostrar div onclick

by pitufoweb

HTML

<a href="#" class="mostrar">Mostrar Contenido</a>

<div class="contenido-a-mostrar">
  <p>Este contenido esta oculto</p>
</div>

CSS

.contenido-a-mostrar {display:none;}

JavaScript

$(".mostrar").click(function(){
  $(this).next(".contenido-a-mostrar").toggle();
  $(this).toggleClass("active");
});