JSFiddle - React, Tailwind, and code Playground

by Sergei Sokolov

HTML

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<h1>раз два три</h1>

JavaScript

/**
 * для вопроса https://qna.habr.com/q/1020604
 * Как сделать поочерёдное появления текста?
 */
const el = document.querySelector('h1');
const words = el.textContent.split(' ');

let current = 0;
const update = () => el.textContent = words[current++ % words.length];

setInterval(update, 1000);
update();