display letter in html element letter by letter

Solutions on MaxInterview for display letter in html element letter by letter by the best coders in the world

showing results for - "display letter in html element letter by letter"
Manuel
21 Jan 2020
1document.addEventListener('DOMContentLoaded', function() {
2
3    showText("#msg", "Hello, World!", 0, 100);
4
5});
6
7let showText = function (target, message, index, interval) {
8    if (index < message.length) {
9        document.querySelector(target).innerHTML =
10            document.querySelector(target).innerHTML + message[index++];
11        setTimeout(function () { showText(target, message, index, interval); }, interval);
12    }
13}
similar questions
html input only letters