Originally Posted by iBall
As soon as you start learning more about the Document Object Model (DOM), you really should then use more appropriate DOM methods to output to the browser.
document.write outputs to the current page only while it is still loading. If called after the the page has loaded, it will output to a new page. document.write is really only useful for writing to child pages.
Using innerHTML is far more straightforward and less error prone for beginners to use than document.write is - there's no reason for using the more complicated document.write rather than innerHTML except in those advanced userscripts where document.write is the only way that works.
There are far fewer situations where innerHTML will break the web page functionality compared to the ways that document.write can break the functionality.