jQuery - remove wrapping tag, but maintain text position? -


let's have scrap of code this:

lorem ipsum <span>dolor sit amet</span>, lorem ipsum dolor...

i can select span jquery , remove dom, removes contained text well. there way, using jquery, remove wrapping span while leaving text in place? possible re-inject text in it's original position, or there easier way?

use $('span').contents().unwrap().

nb: .unwrap() removes parent element (or text node), have descend contents of <span> unwrap them.


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

c - getting error: cannot take the address of an rvalue of type 'int' -

How to merge four videos on one screen with ffmpeg -