title: convert innerHTML string to DOM structure in javascript
body: <p>I would like to convert the following string to DOM structure.</p>
  
  <pre><code>text node &lt;div&gt;div node&lt;/div&gt;text node&lt;p&gt;paraph node&lt;/p&gt; text node
  </code></pre>
  
  <p>One approach is,</p>
  
  <pre><code>mydiv = document.createElement('div');
  mydiv.innerHTML = 'text node &lt;div&gt;div node&lt;/div&gt;text node&lt;p&gt;paraph node&lt;/p&gt; text node';
  </code></pre>
  
  <p>In this approach, the DOM structure is wrapped by another div, which is not i wanted.</p>
  
  <p>After do searching and reading, I found <code>document.createDocumentFragment()</code> is the best way, because when append a <code>fragment</code> to node, it just append <code>fragment's childNodes</code>, not <code>fragment itself</code></p>
  
  <p>unfortunately, <code>innerHTML</code> method is not available in a <code>fragment</code>.</p>
  
  <p>what should i do? thanks</p>