JSFiddle - React, Tailwind, and code Playground

by LyndseyB

HTML

<li class="quotes"> Hello </li>
<li class="quotes"> Lyndsey </li>
<li class="quotes"> Browning </li>

CSS

.quotes { display:none; }

JavaScript

(function() {    
    $(document).ready(function() {
        var quotes =$(".quotes");
        var quoteIndex = -1;
    
        function showNextQuote(){
            ++quoteIndex;
            quotes.eq(quoteIndex%quotes.length)
            .fadeIn(1000)
            .delay(1000)
            .fadeOut(1000, showNextQuote);
        }
        showNextQuote();
    });
})();