createElement
const para = document.createElement("p");
createTextNode
const node = document.createTextNode("seokwon");
appendChild
para.appendChilde(node);
remove
document.getElementById("p1").remove();
removeChild
const parent = document.getElementById("div1");
const child = parent.childNodes[1];
parent.removeChild(child);
replaceChild
const parent = document.getElementById("div1");
const child = parent.childNodes[1];
const newp = document.createElement("p");
const newtext = document.createTextNode("seokwon");
newp.appendChild(newtext);
parent.replaceChild(newp, child);