title: How do I preserve html as is when using Javascript's innerHTML
body: <p>everything is working fine, decodeURIComponent(xmlhttp.responseText) comes back as html from parsing script as checked with alert, no errors in the console, but replacing the html to the editor with</p>
  
  <pre><code>retHTML.innerHTML =decodeURIComponent(xmlhttp.responseText);
  </code></pre>
  
  <p>seems to have a "feature" of translating my html to encoded html(<code>&amp;</code> to <code>&amp;amp;</code>) etc..
  I'm not sure why a command that says it is the inner html would prevent you from actually using html? innerText simply amplifies this rather then returning the html free text as implied. How do I get the returned html back to the div as the html I am requesting?</p>
  
  <pre><code>function setHTML(retHTML)
  {
  retHTML.innerText =retHTML.innerHTML; }
  
  function setTEXT(retHTML)
  {
  var tmpTXT =encodeURIComponent(retHTML.innerText);
  var xmlhttp;
  xmlhttp=new XMLHttpRequest(); 
  xmlhttp.onreadystatechange=function()
  { retHTML.innerHTML =decodeURIComponent(xmlhttp.responseText);  }
  xmlhttp.open("POST","path.php",true);
  xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  xmlhttp.send('send=' + tmpTXT); }
  </code></pre>
  
  <p>test markup as follows</p>
  
  <pre><code>&lt;object width="853" height="510"&gt;
  &lt;param name="movie" value="http://www.youtube.com/v/iaysTVcounI?version=3&amp;amp;hl=en_US&amp;amp;rel=0"&gt;
  &lt;param name="allowFullScreen" value="true"&gt;
  &lt;param name="allowscriptaccess" value="always"&gt;
  &lt;embed src="http://www.youtube.com/v/iaysTVcounI?version=3&amp;amp;hl=en_US&amp;amp;rel=0&amp;amp;autoplay=1" type="application/x-shockwave-flash" width="853" height="510" allowscriptaccess="always" allowfullscreen="true"&gt;
  &lt;/object&gt; 
  </code></pre>
  
  <p>should be </p>
  
  <pre><code>&lt;object width="853" height="510"&gt;
  &lt;param name="movie" value="http://www.youtube.com/v/iaysTVcounI?version=3&amp;hl=en_US&amp;rel=0"&gt;
  &lt;param name="allowFullScreen" value="true"&gt;
  &lt;param name="allowscriptaccess" value="always"&gt;
  &lt;embed src="http://www.youtube.com/v/iaysTVcounI?version=3&amp;hl=en_US&amp;rel=0&amp;autoplay=1" type="application/x-shockwave-flash" width="853" height="510" allowscriptaccess="always" allowfullscreen="true"&gt;
  &lt;/object&gt;
  </code></pre>