How do I create an HTML template that I can copy dynamically?
<p>What's the correct way to do the (pseudo) following:</p>

<pre><code>&lt;div id="myTemplate"&gt;
  &lt;div id="child1"&gt;&lt;/div&gt;
  &lt;span id="child2"&gt;&lt;/span&gt;
&lt;/div&gt;


&lt;script&gt;
  var templateCopy = document.getElementById("myTemplate")
  var copy1 = document.createElementFromTemplate(templateCopy);
  document.appendChild(copy1);
&lt;/script&gt;
</code></pre>

<p>TIA</p>
