How TO - Typing Effect

dblackcat

dblackcat

Golden Member
Joined
August 1, 2024
Messages
291
Reaction score
2,616
Points
93
  • Thread Author
  • #1

Creating a Typing Effect​

Step 1) Add HTML:​

Code:
<p id="demo"></p>

Step 2) Add JavaScript:​


Code:
var i = 0;
var txt = 'Lorem ipsum typing effect!'; /* The text */
var speed = 50; /* The speed/duration of the effect in milliseconds */

function typeWriter() {
if (i < txt.length) {
document..innerHTML += txt.charAt(i);
i++;
setTimeout(typeWriter, speed);
}
}
 
  • Tags
    effect how how to text animation typing typing effect web design