title: How do I copy `<div contentEditable="true">` to `<textarea>` without stripping it out?
body: <p>How do I copy <code>&lt;div contentEditable="true"&gt;</code> to <code>&lt;textarea&gt;</code> without stripping out all the HTML source codes?</p>
  
  <p>I want automatically copy all source codes written in an editable div without stripping them out when they are copied to the textarea.</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
  function copyText() {
  var output = document.getElementById("divtext").innerHTML;
  document.getElementById("text").value = output;
  }
  &lt;/script&gt;
  
  &lt;div id="divtext" contentEditable="true" onkeyup="copyText();" style="text-align:left; width: 499px; height: 230px;"&gt;&lt;/div&gt;
  
  &lt;textarea name="text" id="text" rows="14" cols="54" wrap="soft"&gt;&lt;/textarea&gt;
  </code></pre>
  
  <p>The codes work, they do copy from div to textarea, but they strip them out so what I think is needed is a way to replace the stripped out so to keep or preserve the text as it was written without having it stripped out.</p>
  
  <p>How do I add that replace function?</p>