0
Why does this happen? HTML While loop
U was experimenting with loops and came across this. Idk if this is a beginner question but can someone explain why this happens? https://code.sololearn.com/WKkgW0Jme0Ii/?ref=app Thanks
2 Answers
+ 1
lol
First it is JS while loop not html while loop
Second write JS code inside window.onload function because js code loads first before loading html
Third you are not decrementing 'thing' so result is infinite loop it means blank screen.
0
Just to clarify, sometimes when i ran it, half of the screen went black. It doesnt seem to happen anymore.