Create element from template element?
<p>I'm having some trouble with this:</p>

<pre><code>template = $("#template");
$(template).attr("id", "newid");

$(template).appendTo("body");
</code></pre>

<p>What I want to do is assign an id to the template, then amend the content. Trouble is, I am currently referring to the actual template element, and so the id is changing that. On using this template again, I cannot select as the id is different.</p>

<p>Any advice on optimal approach?</p>
