{"name":"unwrap","type":"method","title":".unwrap()","deprecated":null,"removed":null,"desc":"Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.","categories":["manipulation/dom-insertion-around","manipulation/dom-removal","version/1.4"],"entries":[{"return":"jQuery","signatures":{"added":"1.4"},"examples":{"desc":"Wrap/unwrap a div around each of the paragraphs.","code":"\nvar pTags = $( \"p\" );\n$( \"button\" ).click(function() {\n if ( pTags.parent().is( \"div\" ) ) {\n pTags.unwrap();\n } else {\n pTags.wrap( \"
\" );\n }\n});\n","css":"\n div {\n border: 2px solid blue;\n }\n p {\n background: yellow;\n margin: 4px;\n }\n","html":"\nHello
\ncruel
\nWorld
"},"longdesc":"\nThe .unwrap() method removes the element's parent. This is effectively the inverse of the .wrap() method. The matched elements (and their siblings, if any) replace their parents within the DOM structure.