Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to create textbox with radio button dynamically in jquery
    primarykey
    data
    text
    <p>When I am clicking the button a new row is created with textbox and radio button. But while clicking on the radio button in one row, then the other radio buttons of other rows are deselected.</p> <p>But I want to keep the radio button selected state even if I click other radio buttons.</p> <p>This is my code:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Add More Elements&lt;/title&gt; &lt;script src="../practice/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready (function () { $('.btnAdd').click (function () { $('.buttons').append('&lt;div&gt;&lt;input type="text" name="txt"&gt;M&lt;input type="radio" id="m" name="gender"&gt;F&lt;input type="radio" id="f" name="gender"&gt;&lt;input type="checkbox" name="txt"&gt;&lt;br&gt;&lt;/div&gt;'); // end append }); // end click }); // end ready &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt;This Is Create Textboxs Dinamically &lt;/p&gt; &lt;div class="buttons"&gt; &lt;table&gt;&lt;tr&gt;&lt;td&gt;Name:&lt;/td&gt;&lt;td&gt;Gender:&lt;/td&gt;&lt;td&gt;Choice:&lt;/td&gt;&lt;td&gt;&lt;input type="button" class="btnAdd" value="Click Me To Create TextBox"&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;input type="text" name="txt"&gt;&lt;/td&gt;&lt;td&gt;M&lt;input type="radio" id="m" name="gender"&gt;F&lt;input type="radio" id="f" name="gender"&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="checkbox" name="txt"&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload