ExampleRemove the content of all p elements:
Try it yourself » |
The empty() method removes all content from selected elements, including text and child nodes.
Note: This method does not remove the element itself, or its attributes.
$(selector).empty() |