Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery unwrap() method

jQuery unwrap() method

jQuery HTML/CSS methods jQuery HTML/CSS methods

Example

Remove all

The parent element of the element:

$

(

"

button

"

)

.

click

(

function

(

)

{

$

(

"

p

"

)

.

unwrap

(

)

;

}

)

;

Try it »


Definition and Usage

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


Syntax

$(

selector

).unwrap()


More examples

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


jQuery HTML/CSS methods jQuery HTML/CSS methods