JSFiddle - React, Tailwind, and code Playground

by TrueBlueAussie

HTML

<input type="button" value="run" />
<div class="collapse" id="welcome">
    <p id="yo0">Text here</p>
    <p id="ma0b">Text here</p>
    <p id="blah">Text here</p>
</div>

CSS

.collapse p {
    display: none;
}

JavaScript

var speech = ["#yo0", "#ma0b", "#blah"];

function stuffAppear() {
    var i;
    for (i = 0; i < speech.length; i++) {
        apperance(i);
    }
}
function apperance(i) {
    var x = speech[i];
    setTimeout(function() {$(speech[i]).fadeIn(1000); console.log(i);}, 1000 + i * 1500);
    console.log(speech[i]);
}

$("input").click(function () {
    stuffAppear();
});