lipenco lipenco - 6 months ago 6x
Javascript Question

how can I remove wrapper (parent) without removing the child

I would like to remove parent without removing the child - is this possible?
html structure:

<div class="wrapper">
<img src"">
<div class="button">Remove wrapper</div>

After clicking on button I would like to have :

<img src"">
<div class="button">Remove wrppper</div>


Could use this API:



Code will look something on these lines:

Sample Code

    $('.wrapper img').unwrap();