How to change a cloned radiobuttons name property dynamically?
<p>I have a HTML table which is inside of a <code>div</code> element and I wanted to generate multiple clones of that table whenever user clicks on a button. Up to now, I can generate infinite clones of the table and I can change the table's id dynamically.</p>

<p>My problem is, when I cloned the table, I also cloned the radio buttons inside of it. And all the clonned radiobuttons have the same <code>name</code> attribute. I need to change the name attribute because, although as much as I generate clone table I can only choose one of them.</p>

<p>I searched on the internet but mostly I found non-working answers. This is my script's latest version. Can you help me about how to do it guys?</p>

<pre><code>&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt; clone table - 2 &lt;/title&gt;

        &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"&gt;&lt;/script&gt;

        &lt;script type="text/javascript"&gt;
            $(document).ready(function() {  }); // jQuery is queried for DOM

            function clonetable () {
                var aydi = $('input#gizli').val();
                $table = $('table#tbl0').clone().attr('id', '#table'+aydi).appendTo("#div1");
                aydi++;
                $('input#gizli').val(aydi);     
            }
        &lt;/script&gt;
    &lt;/head&gt;

    &lt;body&gt;
        &lt;input type="button" id="button1" name="clonner" value="clone table" onClick="clonetable()" /&gt;
        &lt;input type="hidden" id="gizli" name="gizli" value="0" /&gt; &lt;br/&gt; &lt;br/&gt;
        &lt;div id="div1"&gt;
            &lt;table border="1" id="tbl0" name="tbl0"&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;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>
