function copyAndAppend(id){
$(“#”+id+” tr:last”).after(“
” + $(“#serviceRow”).html() + “
$(“#”+id+” tr:last”).after(“
” + $(“#serviceRow”).html() + “
“);
}
}
Explanation:
1) $(“#serviceRow”).html() : I will copy all the inner content of an element having id = “serviceRow”
2) $(“#”+id+” tr:last”) : I have used ‘id’ variable, its value will be the id of a table, and “tr:last”.after() will
add the new row at the end of the table
1) $(“#serviceRow”).html() : I will copy all the inner content of an element having id = “serviceRow”
2) $(“#”+id+” tr:last”) : I have used ‘id’ variable, its value will be the id of a table, and “tr:last”.after() will
add the new row at the end of the table
No comments:
Post a Comment