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

26th Oct 2022, 1:33 PM
This is junk email
This is junk email - avatar
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.
26th Oct 2022, 2:44 PM
AÍąJ
AÍąJ - avatar
0
Just to clarify, sometimes when i ran it, half of the screen went black. It doesnt seem to happen anymore.
26th Oct 2022, 1:40 PM
This is junk email
This is junk email - avatar