+ 1
How I use setInterval in this code?
And should I use Timeout? What it does? https://code.sololearn.com/WkwPCQXv0Sok/?ref=app
5 Réponses
+ 2
Use it like this:
<script>
var word=("Hi");
function animacion(){
for(word=1;word<100;word++){
document.write("Hi"+"<br />");
}
}
setInterval(animacion,1000);
</script>
+ 1
to make it very short:
setInterval(function(){
document.write("Hi"+"<br>");
},1000);
+ 1
For me it works fine, you have made a mistake.
Just write what I said:
setInterval(function(){
document.write("Hi"+"<br>");
},1000);
you don't need any for loop or a "Hi" variable for this?!
0
hey, thank you but I don't want all the "Hi" appears at the same time, I want one of the words to appear every 1 second. How I do it?
0
doesn't work