delete parent js

JavaScript
function removeElement(el) {
    el.parentNode.removeChild(el);
}

// or
HTMLElement.prototype.remove = function() { this.parentNode.removeChild(this); return this; }node.parentNode.parentNode.removeChild(node.parentNode)parentElemnet.appendChild(childElemnet);
childElemnet.appendChild(buttonRemoveElement)
buttonRemoveElement.onclick = () => {perentElement.remove(childElement)}
Source

Also in JavaScript: