Answers for "how to type text out woth javascript"

3

javascript typewriter effect

// *** JS Typewriter Effect ***

	let i = 0;
    let target = document.getElementById("target");
    let text = target.innerHTML;
    target.innerHTML = ' ';
    let speed = 75; //speed duration of effect in millisec

    typeWriter(); //to call function
    function typeWriter() {
        if (i < text.length) {
            target.innerHTML += text.charAt(i);
            i++;
            setTimeout(typeWriter, speed);
        }
    }
Posted by: Guest on October-25-2020

Code answers related to "how to type text out woth javascript"

Browse Popular Code Answers by Language