How to clear a document.write()

Tags:



I am trying to clear my little document.write thingy,
but:
document.clear()
doesn’t work (playcode said it was “depcreciated”).

I was trying to look on google 4 the answer but all I was getting was how to clear a form input.

Answer

try document.body.innerHTML = ''



Source: stackoverflow