JSFiddle - React, Tailwind, and code Playground

by Thiago Diniz

HTML

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<div id="wrapp-toggle">
    <span id="title">Abrir</span>
    <div class="wrapp-text hided">Aqui aparece o texto</div>
</div>

CSS

#wrapp-toggle {
    margin:20px
}
.wrapp-text {
    display:block;
}

.wrapp-text.hided{
     display:none;
}

JavaScript

//Pegando o elemento no DOM com função acima
var buttonText = document.getElementById('title');
var wrappText = document.getElementsByClassName('wrapp-text');

alert(buttonText.textContent);

/* buttonText.onclick = function () {
    wrappText.classList.remove('hided');
}; */