The jQuery empty() method is used to remove all child nodes and content from the selected elements. This method doesn't remove the element itself.
If you want to remove the element without removing data and events, you should use the detach() method.
If you want to remove the element as well as its data and events, you should use the remove() method.
Example of jQuery empty() method
Let's take an example to demonstrate the jQuery empty() method.Test it Now
jQuery empty() example 2Test it Now
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week