how do you clear the page in js | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

how do you clear the page in js

so let say someone guessed wrong on a game and the screen has to clear its self how do I do that?

8th Apr 2020, 1:35 PM
ANONYMOUS
ANONYMOUS - avatar
1 Answer
0
document.open(); document.close(); This will reset (clear) the whole document (and restart with empty one)... Any event listener should be forgotten, but js global scope (window object) doesn't forget for almost other js context.
9th Apr 2020, 5:29 AM
visph
visph - avatar