jQuery empty () method
Examples
Remove the contents of all <div> element:
$("button").click(function(){
$("div").empty();
});
$("div").empty();
});
try it"
Definition and Usage
empty () method selected elements from all child nodes and content.
Note: This method does not remove the element itself, or its properties.
Tip: To remove the element, but keep the data and events, use the detach () method.
Tip: To remove the element and its data and events, use the remove () method.
grammar
$(selector).empty()