jQuery empty() vs remove()
The jQuery remove() method will remove the selection and its contents. This method also removes data and events of the selected elements.
Use remove() method when you want to remove the element itself, as well as everything inside it. In addition to the elements themselves, all bound events and jQuery data associated with the elements are removed.
Press the button to remove this heading
The jQuery empty() method will remove all the contents of the selection. This method does not remove the element itself, or its attributes .
In this method you can restore all data but not event handlers of removed elements from the DOM. All data and events related with elements will be removed.