When should one use .innerHTML and when document.write in JavaScript
<p>Is there a general rule, when one should use document.write to change the website content, and when to use .innerHTML?</p>

<p>So far my rules were:</p>

<p>1) Use document.write when ADDING new content</p>

<p>2) Use .innerHTML when CHANGING existing content</p>

<p>But I got confused, since someone told me that on the one hand ".innerHTML" is a strange Microsoft standard, but on the other hand I read that document.write is not allowed in XHTML.</p>

<p>Which structures should I use to manipulate my sourcecode with javaScript?</p>
