English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The empty() method removes all child nodes (including text nodes) from the selected element.
Note:This method does not remove the element itself or its attributes.
To remove an element without removing its data and events (so that they can be re-added later), usedetach()Method.
To remove an element and its data and events, useremove()Method.
$ (selector).empty()
Remove all child nodes (including text nodes) from all paragraphs:
$("button").click(function() { $("p").empty(); });Test and See‹/›