Hello All, i have the below code.
Type writer effect. Java.
I would like for the text animation to keep repeating every 2 seconds .
if you cab plz help me. im not so good at java
\\\\\\\\\\ CODE BELOW \\\\\\\\\\
<!DOCTYPE html>
<html>
<body>
<div class="text">
<p id="demo"></p>
<script>
var i = 0;
var txt = 'APEX LEGANDS SEASON 5 IS ON JUNE 3th this text can go on forever and much more, if you like it it will go on 2 lines and do much more , you jst eed to figre out how to change text font and colors and repeate';
var speed = 40;
function typeWriter() {
if (i < txt.length) {
document.getElementById("demo").innerHTML += txt.charAt(i);
i++;
setTimeout(typeWriter, speed);
}
}
</script>
<style>
.text {
color: green;
font-size: 50px;
}
</style>
</head>
<body onload="typeWriter()">
</body>
</html>