const element = document.getElementById("element") div.parentNode.removeChild(div); element.parentNode.removeChild(element);