How can I add new row after clicking Addrow button. Is this possible to add new row with jquery?
<td>
<input type="button" id="btnnew" value="AddRow" />
</td>
How can I add new row after clicking Addrow button. Is this possible to add new row with jquery?
<td>
<input type="button" id="btnnew" value="AddRow" />
</td>
Yo have to call this jquery on the client click event of the button and add new row in table using jQuery:
$("#btnnew").click(function (){
$('#myTable > tbody:last').append('<tr>...</tr><tr>...</tr>');
}
Create a new TR and add it to table based on table id
$(document).ready(function(){
$("#btnnew").bind("click",function(){
var tr=$("<tr>");
$("table tbody").append(tr);
});
});
Create new row and append it to the parent table
$("#btnnew").click(function (){
$(this).parents("table").append("<tr><td>test</td></tr>");
});