jQuery empty() Method (2024)

Table of Contents
Example Definition and Usage Syntax

❮ jQuery HTML/CSS Methods

Definition and Usage

The empty() method removes all child nodes and content from the selected elements.

Note: This method does not remove the element itself, or its attributes.

Tip: To remove the elements without removing data and events, use the detach() method.

Tip: To remove the elements and its data and events, use the remove() method.

Syntax

$(selector).empty()

❮ jQuery HTML/CSS Methods

W3schools Pathfinder

Track your progress - it's free!

jQuery empty() Method (2024)
Top Articles
Latest Posts
Article information

Author: Manual Maggio

Last Updated:

Views: 5632

Rating: 4.9 / 5 (49 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Manual Maggio

Birthday: 1998-01-20

Address: 359 Kelvin Stream, Lake Eldonview, MT 33517-1242

Phone: +577037762465

Job: Product Hospitality Supervisor

Hobby: Gardening, Web surfing, Video gaming, Amateur radio, Flag Football, Reading, Table tennis

Introduction: My name is Manual Maggio, I am a thankful, tender, adventurous, delightful, fantastic, proud, graceful person who loves writing and wants to share my knowledge and understanding with you.