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
Post a Comment