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 -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -