How can I remove wrapper (parent element) without removing the child?

Pure JS (ES2015) solution, in my opinion easier to read than jQuery-solutions.

node.replaceWith(...node.childNodes)

Node has to be an ElementNode

const wrapperNode = document.querySelector('h1')
wrapperNode.replaceWith(...wrapperNode.childNodes)
<h1>
  <a>1</a>
  <b>2</b>
  <em>3</em>
</h1>

Leave a Comment