Hello, I am currently stuck on a looping exercise and I could use some assistance.
I need to display each iteration of the loop inside a < p > </ p > tag
Looping away
Looping away
Looping away
Looping away
Looping away
Below is my code
var count = 0;<br>
while (count <10) {<br>
document.getElementById('loopDisplay').textContent += 'looping away';<br>
count++;<br>
}
The above code outputs:
"awaylooping awaylooping awaylooping awaylooping awaylooping awaylooping awaylooping awaylooping awaylooping away".
I have tried adding < p> tags, using quotation marks, and various other methods, but unfortunately nothing seems to work. I am new to JavaScript and struggling with this basic concept. Any help would be greatly appreciated. Thank you!