how to modify clone of an html table?
<p>I'm trying to make some sort of survey form. I managed to increase id and name dynamically and i can add different answer types. The problem is when i want to add radiobutton it adds 5 of them. same as checkbox too. But when try to add textfield, i want it to add only 1 but it adds 5 because of my hidden table's structure.</p>

<p>hoca can i solve this problem? here is my code:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;clone table - 2.0&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() {
    });
    function cloneRadio() {
        var aydi = $('input#gizli').val();
        $table = $('table#table0').clone().attr('id', 'table' + aydi).attr(
                'name', 'table' + aydi).appendTo("#div1");
        $("input[type='radio']", $table).prop("name", "ans" + aydi);
        $("p", $table).prop("id", "questionTXT_" + aydi);
        aydi++;
        $('input#gizli').val(aydi);
    }
    function cloneCheck() {
        var aydi = $('input#gizli').val();
        $table = $('table#table0').clone().attr('id', 'table' + aydi).attr(
                'name', 'table' + aydi).appendTo("#div1");
        $("input[type='radio']", $table).prop("name", "ans" + aydi);
        $("input[type='radio']", $table).prop("type", "checkbox");
        $("p", $table).prop("id", "questionTXT_" + aydi);
        aydi++;
        $('input#gizli').val(aydi);
    }

    function cloneTextField() {
        var aydi = $('input#gizli').val();
        $table = $('table#table0').clone().attr('id', 'table' + aydi).attr(
                'name', 'table' + aydi).appendTo("#div1");
        $("input[type='radio']", $table).prop("name", "ans" + aydi); // to increase name property of radiobuttons
        $("input[type='radio']", $table).prop("type", "text"); // turns radiobuttons to checkboxes
        $("p", $table).prop("id", "questionTXT_" + aydi);
        aydi++;
        $('input#gizli').val(aydi);
    }
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;input type="hidden" id="gizli" name="gizli" value="1" /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    &lt;!-- HIDDEN VARIABLE IS FOR INCREASING ID --&gt;
    &lt;div id="div0" style="display: none"&gt;
        &lt;table border="1" id="table0" name="table0"&gt;
            &lt;tr&gt;
                &lt;td colspan="5"&gt;
                    &lt;p id="questionTXT_1"&gt;Question text will be here&lt;/p&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;&lt;input type="radio" id="A" name="ans0" /&gt; answer1 &lt;br /&gt;
                &lt;/td&gt;
                &lt;td&gt;&lt;input type="radio" id="B" name="ans0" /&gt; answer2 &lt;br /&gt;
                &lt;/td&gt;
                &lt;td&gt;&lt;input type="radio" id="C" name="ans0" /&gt; answer3 &lt;br /&gt;
                &lt;/td&gt;
                &lt;td&gt;&lt;input type="radio" id="D" name="ans0" /&gt; answer4 &lt;br /&gt;
                &lt;/td&gt;
                &lt;td&gt;&lt;input type="radio" id="E" name="ans0" /&gt; answer5 &lt;br /&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;
    &lt;/div&gt;
    &lt;div id="div1"&gt;
        &lt;!-- CLONNED TABLES WILL BE HERE --&gt;
    &lt;/div&gt;
    &lt;div&gt;
        &lt;input type="button" id="button1" name="clonner"
            value="Add Radiobutton" onClick="cloneRadio()" /&gt; &lt;input
            type="button" id="button1" name="clonner" value="Add Checkbox"
            onClick="cloneCheck()" /&gt; &lt;input type="button" id="button1"
            name="clonner" value="Add TextField" onClick="cloneTextField()" /&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
