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

Receive udp packets in android gstreamer -

php - Extract Text from HTTP referer -

matplotlib - PYTHON: Annotate boxes disapear dependant on range -