DOM - AppendChild

1 - About

AppendChild is a node dom tree operation that adds a children node at the end of all already existing children of this node.

3 - Syntax

returnedValue = node.appendChild(Node|documentFragment)


  • returnedValue is:
    • the appended child if the argument is a node
    • the empty DocumentFragment if the argument is a DocumentFragment

4 - Example

With the HTML DOM

for (var i=0;i<=3;i++){
  let p = document.createElement("p");
  p.innerText = "Lorem Ipsom "+i;
  • Append it to the body
  • Result:

Data Science
Data Analysis
Data Science
Linear Algebra Mathematics

Powered by ComboStrap