Skip to content
Advertisement

How to clear a document.write()

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.

Advertisement

Answer

try document.body.innerHTML = ''

Advertisement