","upvoteCount":2},{"@type":"Answer","text":"to make it very short:\nsetInterval(function(){\n document.write(\"Hi\"+\"
\");\n},1000);","upvoteCount":1},{"@type":"Answer","text":"For me it works fine, you have made a mistake.\nJust write what I said:\n\nsetInterval(function(){\n document.write(\"Hi\"+\"
\");\n},1000);\nyou don't need any for loop or a \"Hi\" variable for this?!","upvoteCount":1},{"@type":"Answer","text":"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?","upvoteCount":0},{"@type":"Answer","text":"doesn't work","upvoteCount":0}]} }
+ 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 ответов
+ 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 🇪🇸