unwrap

Module

Methods

dom.unwrap()
void unwrap ( selector )
移除符合 selector 的节点的父节点
Parameters:selector (string|HTMLCollection|Array<HTMLElement>) – 字符串表示 css3 选择器
<div class="container">
  <div class="new">
    <div class="inner">Hello</div>
  </div>
  <div class="new">
    <div class="inner">Goodbye</div>
  </div>
</div>

after

DOM.unwrap(".inner");

become

 <div class="container">
  <div class="inner">Hello</div>
  <div class="inner">Goodbye</div>
</div>