title: Converting HTML string into DOM elements?
body: <p>Is there a way to convert HTML like:</p>
  
  <pre><code>&lt;div&gt;
  &lt;a href="#"&gt;&lt;/a&gt;
  &lt;span&gt;&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>or any other HTML string into DOM element? (So that I could use appendChild()). I know that I can do .innerHTML and .innerText, but that is not what I want -- I literally want to be capable of converting a dynamic HTML string into a DOM element so that I could pass it in a .appendChild().</p>
  
  <p>Update: There seems to be confusion. I have the HTML contents in a string, as a value of a variable in JavaScript. There is no HTML content in the document.</p>