This is a very basic question. I have this script:
When it is executed after the page has completed loading, it overwrites the entire content - one of the points raised in the answer to this question: Why is document.write considered a "bad practice"?