JavaScript can write directly into the HTML output stream: Yipee. What else can we write?

You can only use document.write in the HTML output. If you use it after the document has loaded (e.g. in a function), the whole document will be overwritten.