English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The unwrap() method removes the parent element of the selected element.
Usagewrap()The method wraps the specified HTML element around the selected element.
$.unwrap(selector)
Remove all paragraphs' parent elements:
$("button").click(function(){ $("p").unwrap(); });Test and See‹/›
Toggle between wrapping and expanding elements:
$("#btn1").click(function(){ $("p").wrap("<div></div>"); }); $("#btn2").click(function(){ $("p").unwrap(); });Test and See‹/›