I cloned a row from a table, I want to remove the last cloned row by clicking the delete button.
Here is my script
$("#btnAddMoreUser").on("click",function(){
var newClass='newClass';
var $tableBody = $('#tblAddUser').find("tbody"),
$trLast = $tableBody.find("tr:last"),
$trNew = $trLast.clone().addClass(newClass);
$trLast.after($trNew);
});
$(".tr_clone_remove").on("click",function(){ //Once remove button is clicked
$(".newClass:last").remove(); //Remove field html
x--; //Decrement field counter
});
Below is my fiddle