element.remove()
const element = document.getElementById("demo");
element.remove();