problem in display for loop | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

problem in display for loop

hey guys I have a problem that I receive just the least object in my browser but this runs true in the console! how can I resolve? https://code.sololearn.com/WeCw2bV6DwRJ/#

18th May 2020, 1:14 AM
Alireza Babaei
Alireza Babaei - avatar
3 Answers
+ 5
when we use innerHTML="something" all content is deleted, but we can use innerHTML+="something2" Replace in line 43 by: document.getElementById('text').innerHTML +="<hr>" +text;
18th May 2020, 2:08 AM
CoffeeByte
CoffeeByte - avatar
+ 3
In the last line of the for loop code block it should be += instead of =.
18th May 2020, 2:13 AM
ODLNT
ODLNT - avatar
0
ODLNT that's right
18th May 2020, 2:16 AM
CoffeeByte
CoffeeByte - avatar