JSFiddle - React, Tailwind, and code Playground

by wrxsti85

HTML

<p>test0</p>
<p>test1</p>
<p>test2</p>
<p>test3</p>
<p>test4</p>

JavaScript

function injectTextAllP() {
        var numP = jQuery('p').length - 1;
        var pcount = 0;

        
        var nIntervId = setInterval(function() {
            var scount = pcount+'';
            var innards = $('p:eq(scount)').html();
            if(pcount <= numP){ 
              alert('BIOTCH! ' + innards);
              pcount = pcount + 1;
            }
            else {
            clearInterval(nIntervId);
            }
        }, 3000);
}

$(function(){

    injectTextAllP();

});