<html>
<body>
<h1>Typewriter</h1>
<button onclick="typeWriter()">Click me</button>
<p id="demo"></p>
<script>
var i = 0;
var txt = 'Lorem ipsum dummy text blabla.';
var speed = 50;
function typeWriter() {
if (i < txt.length) {
document.getElementById("demo").innerHTML += txt.charAt(i);
i++;
setTimeout(typeWriter, speed);
}
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/howto/tryit.asp?filename=tryhow_js_typewriter by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:39:19 GMT -->
</html>