$.append adding to last element in table row instead of creating new row
Hello,
Im trying to insert a new row in a table. But instead its appending to the last element in the row. Ive done this a hundred times, and it's not working now
I should have gone into underwater demolition like my mother wanted me to ...
- // Add container
- $("#dtltbl").on("click", ".addCont", (function () {
- var $classes = $(this).closest("tr").prop("class");
- var $class = "." + $.trim($classes.replace("itemno",""));
- var $dtl = $("#dtltmpl").html(); // variable that stores table row
- $($class).next('tr').append($($dtl)); //added to last element of current row
- }));