Adding Dynamically control in table rows using jquery
I want to add Dynamically the all controls as it in previous row with class name . for this i have done this , but it is too complecated.
and my jquery is here
- <table id="Myt">
- <tr>
- <td><input type="text" class="fAge" ></input> </td>
- <td><input type="text" class="lAge" ></input> </td>
- <td><input type="Checkbox" class="elegible" >Eligible</input> </td>
- <td><a href="#" class="addmore">Add More</a> </td>
- </tr>
- </table>
- my jquery
- $('.addmore').on('click',function()
- {
-
- $('#Myt tr').last().after('<tr><td><input type="text" class="fAge" ></input></td><td><input type="text" class="lAge" ></input></td><td><input type="Checkbox" class="elegible" >Eligible</input></td><td><a href="#" class="addmore">Add More</a> </td></tr>');
- });
but the on clicking the newly added row, it doesn't add new row to table
jsfiddle link
http://jsfiddle.net/79Lyp/