javascript - How to remove a div without removing its children? -


for example http://jsfiddle.net/skpfknxo/

it removes div #test along children #test2 , #test3. want remove #test without removing children.

how done?

$( "button" ).click(function() {   $( "#test2" ).unwrap(); }); 

demo

the .unwrap() method removes element's parent. inverse of .wrap() method. matched elements (and siblings, if any) replace parents within dom structure.


Comments

Popular posts from this blog

javascript - How to bind ViewModel Store to View? -

recursion - Can every recursive algorithm be improved with dynamic programming? -

python - Alternative to referencing variable before assignment -