23 of 119 menu

The unwrap method

The unwrap method performs the inverse operation of the wrap method.

Syntax

So we will use the method:

.unwrap();

You can also pass an optional parameter to the method as a string, as a selector; if the element's parent does not match the specified selector, the method will not be applied to it:

.unwrap(selector);

Example

Let's do unwrap on all paragraphs with class www:

<div><p class="www">text</p></div> <div><p class="www">text</p></div> <div><p class="www">text</p></div> <div><p>text</p></div> $('.www').unwrap();

HTML the code will look like this:

<p class="www">text</p> <p class="www">text</p> <p class="www">text</p> <div><p>text</p></div>

See also

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline