jQuery Remove

tutorial and example
tutorial and example

Using the jQuery, it is easy to remove the existing HTML content.

There are two jQuery methods to remove the content:

jQuery remove() Method

The jQuery remove() method is used to remove the selected element(s) and its child elements. It also removes the data and the events of the selected elements.

Syntax:

Selector: It is used to specify whether to remove one or more elements. You can use comma (,) to separate more than one element. It is an optional parameter.

Example:

Try Now

jQuery empty() Method

The jQuery empty() method is used to remove the child elements of the selected element(s). It doesn’t remove the element itself.

Syntax:

Example:

Try Now