JSFiddle - React, Tailwind, and code Playground
HTML
<span id="lips"></span>
JavaScript
function lips(el, time) {
time = time || 250;
if (!el) {
throw new Error('Oops, you forgot the element');
}
el.innerHTML = '...';
setInterval(function () {
var len = el.innerHTML.split('').length;
if (len < 3) {
el.innerHTML = el.innerHTML + '.';
} else {
el.innerHTML = '';
}
}, time);
}
lips(document.querySelector('#lips'), 100);