Remove or empty elements
remove() deletes the element. empty() only clears what is inside it.
jQuery · Remove or empty elementsBeginner
$('.old').remove(); // delete all with class old
$('#results').empty(); // keep the box, clear its content
$('.delete').on('click', function () {
$(this).closest('tr').remove(); // delete the row this button is in
});removeemptydetach