How to change attributes of clonned html table and radiobutton?
<p>I'm new with JavaScript and jQuery. I clonned below html table with this jQuery script:</p>

<pre><code>$("#table1").clone().appendTo("#div1");
</code></pre>

<p>And this is my html table:</p>

<pre><code>&lt;div id="div1"&gt;
        &lt;table border="1" id="table1"&gt;
        &lt;tr&gt;
            &lt;td colspan="5"&gt;Question text will be here&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;input type="radio" id="A" name="ans" /&gt;answer1 &lt;br /&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input type="radio" id="B" name="ans" /&gt;answer2 &lt;br /&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input type="radio" id="C" name="ans" /&gt;answer3 &lt;br /&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input type="radio" id="D" name="ans" /&gt;answer4 &lt;br /&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input type="radio" id="E" name="ans" /&gt;answer5 &lt;br /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;/table&gt;

        &lt;table border="1" id="table1"&gt;
        &lt;tr&gt;
            &lt;td colspan="5"&gt;Question text will be here&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;input type="radio" id="A" name="ans" /&gt;answer1 &lt;br /&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input type="radio" id="B" name="ans" /&gt;answer2 &lt;br /&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input type="radio" id="C" name="ans" /&gt;answer3 &lt;br /&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input type="radio" id="D" name="ans" /&gt;answer4 &lt;br /&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input type="radio" id="E" name="ans" /&gt;answer5 &lt;br /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;/table&gt;
    &lt;/div&gt;
</code></pre>

<p>And now, I'm trying to is, changing id of clonned tables and clonned radiobuttons. I need to change clonned tables id properties, otherwise i can't select them on following steps of my project. And i also need to change name property of all radiobuttons, because i can only select one radiobutton on browser when it's like this.</p>

<p>I've read the documentation about the .attr() api over this page: <a href="http://api.jquery.com/attr/" rel="nofollow">http://api.jquery.com/attr/</a> . So I know how to change the attributes of an html element with jQuery, but i don't know, how to change these attributes of clonned html elements dynamically.</p>

<p>Can you help me with this please?</p>
