JSFiddle - React, Tailwind, and code Playground

by Emmanuel Garcia

HTML

<div>
    <span>This is so</span>
    <span id="rotate-word">Photo by: Grayskullduggery</span>
</div>

JavaScript

$(function() {
    var words = ['Photo by: Grayskullduggery', 'fantastic2', 'incredible3', 'awesome4'],
        index = 0,
        $el = $('#rotate-word')
    setInterval(function() {
        index++ < words.length - 1 || (index = 0);
        $el.fadeOut(function() {
            $el.text(words[index]).fadeIn();
        });
    }, 3000); 
});