+ 1

How I use setInterval in this code?

And should I use Timeout? What it does? https://code.sololearn.com/WkwPCQXv0Sok/?ref=app

2nd Sep 2018, 1:59 PM
Artur Spain 🇪🇸
5 Answers
+ 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>
2nd Sep 2018, 3:05 PM
BraveHornet
BraveHornet - avatar
+ 1
to make it very short: setInterval(function(){ document.write("Hi"+"<br>"); },1000);
3rd Sep 2018, 8:03 PM
BraveHornet
BraveHornet - avatar
+ 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?!
3rd Sep 2018, 10:31 PM
BraveHornet
BraveHornet - avatar
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?
3rd Sep 2018, 1:33 PM
Artur Spain 🇪🇸
0
doesn't work
3rd Sep 2018, 8:21 PM
Artur Spain 🇪🇸