I'm looking for a way to remove the entire content of a web page using pure Javascript -- no libraries.
I tried:
document.documentElement.innerHTML = "whatever";
but that doesn't work: it replaces the inside of the <html/>
element. I'm looking at replacing the entire document, including if possible the doctype
and <?xml
declaration.
location = 'about:blank'
– Yi Jiang Nov 22 '10 at 1:01<?xml
and doctype are). – Dean Harding Nov 22 '10 at 1:02