Table of Contents

DOM - AppendChild

About

AppendChild is a node dom tree operation that:

as children at the end of all already existing children of this node.

Syntax

returnedValue = node.appendChild(Node|documentFragment)

where:

Example

With the HTML DOM

for (var i=0;i<=3;i++){
  let p = document.createElement("p");
  p.innerText = "Lorem Ipsom "+i;
  document.body.appendChild(p);
}