Is there a way to completely erase all the html on a page using javascript?

Know It All

New member
I have tried a million different methods:
document.getElementsByTagName("body").value=' '
"-".innerHTML
document.getElementById
document.getElementByName
document.body.value=" "
"-".innerHTML
and many others, and I just cant figure it out. I need to use JS to clear the HTML in a page, so that I can rewrite the page. Does anyone at all know how to clear the page by using only JS?
 
I would think either

document.body.innerHTML = "";

or

document.getElementsByTagName("body") [ 0 ] .innerHTML = "";

would work?

Update: I verified both of these methods in FireBug and they both seem to work.
 
Back
Top