jQuery Document Manipulation - unwrap() Method

Example

Remove the parent elements of all <p> elements:

$("button").click(function() {
  $("p").unwrap();
});

Try it yourself

Definition and usage

The unwrap() method removes the parent element of the selected element.

Syntax

$(selector.unwrap()

More examples

Wrap or unwrap elements
Toggle between wrapping and unwrapping elements.