title: Display HTML code in Javascript string
body: <p>I hope the title explains what I'd like to achieve. If not, please read on!</p>
  
  <p>I am currently coding a Lorem Ipsum generator (as a learning experience, though I may have it on my site for S&amp;G's)</p>
  
  <p>So far, I've managed to get the code to output a random sentence from a list, into the text box. I've also created a generator for creating Lorem Ipsum bullet lists.
  Whenever someone generates some text via the tool, I'd like to have one box with the formatted text (paragraphes, bulleted, etc) and then another box with the raw HTML code, so designers can just copy and paste the code straight into their coding program. So far, I've sorted out the formatted text box, but I'm having issues with the raw HTML.</p>
  
  <p>This is what I've got so far:</p>
  
  <p>[Obviously there's a var listArray at the beginning, but I won't bother adding that.]</p>
  
  <pre><code>var randomList = listArray[(Math.floor(Math.random() *listArray.length))]
  
  document.getElementById("textarea").innerHTML = "&lt;li&gt;" + (randomList) + "&lt;/li&gt;" + "&lt;li&gt;" + (randomList) + "&lt;/li&gt;" + "&lt;li&gt;" + (randomList) + "&lt;/li&gt;";
  document.getElementById("textarea-code").innerHTML = "&lt;li&gt;" + randomList + "&lt;/li&gt;" + "&lt;li&gt;" + randomList + "&lt;/li&gt;" + "&lt;li&gt;" + randomList + "&lt;/li&gt;";}
  </code></pre>
  
  <p>The second innerHTML line is just a copy of the first, and is the line I want to work on.</p>
  
  <p>How do I get that second line to output:</p>
  
  <pre><code>&lt;li&gt; Line 1 &lt;/li&gt;
  &lt;li&gt;li Line 2 &lt;/li&gt;
  </code></pre>
  
  <p>into the HTML text box, instead of putting the list items into a bulleted point?</p>