Monday, September 8, 2014

COPY PARTICULAR ROW OF A TABLE AND APPEND IT AT THE END OF TABLE

function copyAndAppend(id){
$(“#”+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

No comments:

Post a Comment