jQuery unwrap() method
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