.detach()

In this chapter you will learn:

  1. Syntax and Description for .detach() method

Syntax and Description

.detach([selector])

Remove the set of matched elements from the DOM. selector (optional) is a selector expression that filters the set of matched elements to be removed. Its return value is the jQuery object, for chaining purposes. The removed elements are still referenced by this object, even though they are no longer in the DOM.

This method is useful when removed elements are to be reinserted into the DOM at a later time.

Next chapter...

What you will learn in the next chapter:

  1. Syntax and Description for .filter() method
  2. How to filter element by its id
  3. How to filter by index
  4. How to filter by css style
  5. How to filter by node type