0
これは私が処理しようとしている段落です。私はここではJavaScriptinsertBefore()の親として使用するもの
<p id="mySpecialParagraph">Well hello there, user</p>
を使用して、それが最後の行にpId.parentNode.insertBeforeのために代わりに使用すべきか、関連するjavascriptのである前に、新しい段落を挿入しようとするのですか?
var pId = document.getElementById("mySpecialParagraph").nodeValue;
var pNew = document.createElement("P");
var text = "This should apperar before the other paragraph";
var t = document.createTextNode(text);
pNew.appendChild(t);
pId.parentNode.insertBefore(pNew, pId);