Merging Text Nodes Together After Inserting Span

后端 未结 4 1493
离开以前
离开以前 2020-12-14 01:08

I have an extension where I am storing/retrieving a section of the DOM structure (always a selection of text on the screen) the user has selected. When I am storing a select

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-14 01:43

    You can use this to unwrap your content.

    $(".highlightYellow").contents().unwrap(); 
    

    Demo: http://jsfiddle.net/R4hfa/

提交回复
热议问题