JSFiddle - React, Tailwind, and code Playground
HTML
<div id="log"></div>
JavaScript
window.addEvent("domready", function() {
var log = $("log");
var count = 0;
var addDot = function() {
if (count < 20) {
this.set("text", this.get("text") + ".");
count++;
} else {
log.empty();
count = 0;
}
};
var myPeriodical = addDot.periodical(50, log);
(function() { $clear(myPeriodical); }).delay(4000);
});