jQuery empty() method
Example
Remove all
element's content changes:
$
(
"
button
"
)
.
click
(
function
(
)
{
$
(
"
div
"
)
.
empty
(
)
;
}
)
;
Try it »
Definition and Usage
The empty() method removes all child nodes and content from the selected elements.
**Note:** This method does not remove the elements themselves or their attributes.
**Tip:** To remove the elements but keep their data and events, use detach() method.
**Tip:** To remove the elements along with their data and events, use remove() method.
Syntax
$(
selector
).empty()
jQuery HTML/CSS methods