jQuery Document Manipulation - empty() Method
Example
Remove the content of the p element:
$(".btn1").click(function() { $("p").empty(); });
Definition and Usage
The empty() method removes all content from the selected elements, including all text and child nodes.
Syntax
$(selector.empty()
More examples
- Remove the content of the element
- Remove content from elements using the empty() method.