ベストアンサー1
始めるためのスニペットを以下に示します。
theParent = document.getElementById("theParent");
theKid = document.createElement("div");
theKid.innerHTML = 'Are we there yet?';
// append theKid to the end of theParent
theParent.appendChild(theKid);
// prepend theKid to the beginning of theParent
theParent.insertBefore(theKid, theParent.firstChild);
theParent.firstChild
内部の最初の要素への参照が提供されtheParent
、theKid
その前に配置されます。