lipenco lipenco - 2 years ago 57
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>

Answer Source

Could use this API:



Code will look something on these lines:

Sample Code

    $('.wrapper img').unwrap();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download