You can display paragraphs one by one as follows:
var sentences = ['sentenceone', 'another sentence', 'another sentence again']; var i = 0; $(".btn").on('click', function() { if (i < sentences.length) { samplebox.innerHTML += '<p>' + sentences[i] + '</p>'; i++; } });
R3tep source share