X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

jQuery unwrap() Method

jQuery HTML/CSS Methods jQuery HTML/CSS Methods

Example

Remove the parent element 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 elements.


Syntax

$(selector).unwrap()


Examples

Try it Yourself - Examples

Wrap and unwrap an element
How to toggle between wrapping and unwrapping an element.


jQuery HTML/CSS Methods jQuery HTML/CSS Methods


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook