title: Javascript append fragment to an existing HTML element
body: <p>I have created a DOM fragment where I am adding several childNodes in a loop:</p>
  
  <pre><code>fragment.appendChild( clone )
  </code></pre>
  
  <p>I want to take this fragment and use it to replace an existing HTML element that already contain those nodes.</p>
  
  <p>I can use </p>
  
  <pre><code>myContainer.appendChild(fragment)
  </code></pre>
  
  <p>However this is done also in a loop and the fragment is appended too many times.
  How can I get the fragment, append it to myContainer and delete also myContainer's old childs.</p>
  
  <p>Thank you.</p>