jQuery unwrap()Method

jQuery HTML/CSS 方法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()


实例

More Examples

Wrap and unwrap elements
How to switch between the tasks of wrapping and unwrapping elements.


jQuery HTML/CSS 方法jQuery HTML/CSS Methods

Other extensions