Javatpoint Logo
Javatpoint Logo

jQuery remove()

The jQuery remove() method is used to remove the selected elements out of the DOM. It removes the selected element itself, as well as everything inside it (including all texts and child nodes). This method also removes the data and the events of the selected elements.

If you want to remove elements without removing data and events, you should use the detach() method. If you want to remove only data and events, use the empty() method.

Syntax:

Parameters of jQuery remove() method:

Parameter Description
Selector is an optional parameter. It specifies whether to remove one or more elements. If you have to remove more than one element then you should separate them with comma (,).

Example of jQuery remove() method

Test it Now

jQuery remove() example 2

Test it Now
Next TopicjQuery empty()





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA