Description: Remove sầu the phối of matched elements from the DOM.

Bạn đang xem: Remove all div in div jquery

version added: 1.0 .remove( )

Similar to .empty(), the .remove() method takes elements out of the DOM. Use .remove() when you want khổng lồ remove the element itself, as well as everything inside it. In addition lớn the elements themselves, all bound events and data associated with the elements are removed. To remove the elements without removing data & events, use .detach() instead.

Xem thêm: Download Phần Mềm Ncstudio, Download Phần Mềm Nc Studio V5

Consider the following HTML:

If we had any number of nested elements inside

, they would be removed, too. Other constructs such as data or sự kiện handlers are erased as well.

We can also include a selector as an optional parameter. For example, we could rewrite the previous DOM removal code as follows:

Removes all paragraphs that contain "Hello" from the DOM. Analogous to doing $("p").filter(":contains('Hello')").remove().

Ajax Global Ajax Event Handlers Helper Functions Low-Level Interface Shorth& Methods Attributes Callbacks Object Vi xử lý Core CSS Data Deferred Object Deprecated Deprecated 1.3 Deprecated 1.7 Deprecated 1.8 Deprecated 1.9 Deprecated 1.10 Deprecated 3.0 Deprecated 3.2 Deprecated 3.3 Deprecated 3.4 Deprecated 3.5 Dimensions Effects Basics Custom Fading Sliding Events Browser Events Document Loading Event Handler Attachment Event Object Form Events Keyboard Events Mouse Events Forms Internals Manipulation Class Attribute Copying DOM Insertion, Around DOM Insertion, Inside DOM Insertion, Outside DOM Removal DOM Replacement General Attributes Style Properties Miscellaneous Collection Manipulation Data Storage DOM Element Methods Setup Methods Offphối Properties Properties of Object Instances Properties of the Global Object Removed Selectors Attribute Basic Basic Filter Child Filter Content Filter Form Hierarchy Extensions Visibility Filter Traversing Filtering Miscellaneous Traversing Tree Traversal Utilities Version Version 1.0 Version 1.0.4 Version 1.1 Version 1.1.2 Version 1.1.3 Version 1.1.4 Version 1.2 Version 1.2.3 Version 1.2.6 Version 1.3 Version 1.4 Version 1.4.1 Version 1.4.2 Version 1.4.3 Version 1.4.4 Version 1.5 Version 1.5.1 Version 1.6 Version 1.7 Version 1.8 Version 1.9 Version 1.12 & 2.2 Version 3.0 Version 3.1 Version 3.2 Version 3.3 Version 3.4 Version 3.5


Learning Fourth Edition Karl Swedberg and Jonathan Chaffer
* in Action Bear Bibeault, Yehuda Katz, & Aurelio De Rosa
* Succinctly Cody Lindley
Learning Center Forum Twitter IRC GitHub

Copyright 2021 OpenJS Foundation & contributors. All rights reserved. See License for more information. The OpenJS Foundation has registered trademarks & uses trademarks. For a list of trademarks of the OpenJS Foundation, please see our Trademark Policy và Trademark List. Trademarks & logos not indicated on the danh sách of OpenJS Foundation trademarks are trademarks™ or registered® trademarks of their respective sầu holders. Use of them does not imply any affiliation with or endorsement by them. OpenJS Foundation Terms of Use, Privacy, and Cookie Policies also apply. Web hosting by Digital Ocean | CDN by StackPath