I'm trying to create a typewriter function for a school project and i'm not sure why its not working
HTML code:
<h1 id="typewriter"></h1>
Javascript code:
typewriter();
function typewriter() {
var textArray = text1.split("");
for (var i = 0; i < textArray.length; i++) {
document.getElementById('typewriter').innerHTML = textArray[i];
setTimeout(typewriter, 80);
}
}
Thanks in advance for the help!