[X]

Typewriter Text

text effects 1998 still works

Types a message out one character at a time.

In 2026: Works unchanged. The original used document.all, this version uses getElementById so it runs everywhere.

Where it came from: Dynamic Drive and The JavaScript Source, roughly 1998. MDN

<span id="typed"></span><span id="caret">_</span>

<script language="JavaScript">
var msg = "Welcome to my corner of the internet...";
var i = 0;
function typeIt() {
  if (i < msg.length) {
    document.getElementById("typed").innerHTML += msg.charAt(i++);
    setTimeout(typeIt, 90);
  }
}
setInterval(function () {
  var c = document.getElementById("caret");
  c.style.visibility = (c.style.visibility === "hidden") ? "visible" : "hidden";
}, 500);
typeIt();
</script>
sandboxed demo · breaks nothing but itselfrestart

More in text effects

all 15 in text effects › · the whole library ›