VOOZH about

URL: https://www.geeksforgeeks.org/jquery/jquery-empty-method/

⇱ jQuery empty() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

jQuery empty() Method

Last Updated : 10 Jul, 2023

The empty() method is an inbuilt method in jQuery that is used to remove all child nodes and their content for the selected elements.

Syntax:

$(selector).empty()

Parameter: This method does not accept any parameter.

Return Value: This method returns the selected element with the specified changes made by the empty() method.

The below example illustrates the empty() method in jQuery:

Example: In this example, we are using the jquery empty() method.

Output:

👁 jquery-11


Comment
Article Tags:

Explore