title: Replacing document.documentElement.innerHTML in Internet Explorer
body: <p>The following works flawlessly (as far as I can tell) in all other browsers:</p>
  
  <pre><code>document.documentElement.innerHTML = "&lt;head&gt;&lt;/head&gt;&lt;body&gt;Testing&lt;/body&gt;";
  </code></pre>
  
  <p>But chokes in IE (I tested IE9), with a console error:</p>
  
  <pre><code>SCRIPT600: Invalid target element for this operation. 
  </code></pre>
  
  <p>...referencing the first character of the line of code above.</p>
  
  <p>Why won't this work in IE, but will work in all other browsers? I read somewhere that <code>innerHTML</code> has issues replacing 'TBODY' elements, but I tested this line of code after removing all TBODY children and the same error occurred.</p>
  
  <p>I know this sounds like bad-news-code, but it is the only option I have left with the very limited and simplistic CMS website we are being forced to use. I'm only thankful that the CMS allows scripts to be executed.</p>
  
  <p>In essence, I need to be able to completely gut the HTML contents and use my own. Again, this works fine on other browsers.</p>
  
  <p>Other notes:</p>
  
  <ul>
  <li>The CMS is using the <code>prototype.js</code> library (it's already loaded before I run this code)</li>
  <li>The Doctype is: <code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;</code></li>
  <li>The CMS scripts use <code>prototype.js</code> to dynamically add two <code>div</code>s full of content at page load</li>
  </ul>