This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.



Smartphone icons created by Freepik - Flaticon

JS HTML DOM

Add a new HTML Element.

This is a paragraph.

This is another paragraph.

// Create a new paragraph(element node)
const para = document.createElement("p");
const node = document.createTextNode("This is new.");
para.appendChild(node);

// append Child node to div1 element
const element = document.getElementById("div1");
const child = document.getElementById("p1");
element.insertBefore(para,child);