JSFiddle - React, Tailwind, and code Playground

by survivant

HTML

<span id="holder"></span>

JavaScript

(function($) {
    $.fn.writeText = function(content) {
        var contentArray = content.split(""),
            current = 0,
            elem = this;
            
        var interval = setInterval(function() {
            if(current < contentArray.length) {
                elem.text(elem.text() + contentArray[current++]);
            } else {
            	console.log('..');
              clearInterval(interval);
            }
        }, 100);
    };
    
})(jQuery);
$("#holder").writeText("This is some text");