Learn HTML DOM
Manipulating DOM Elements
4.10
Lesson

Append HTML Element

To add HTML elements as nested elements inside another element, we use the appendChild method.

The appended child gets added to the last, after all other children of the parent element.

It isn’t necessary to append only newly created elements. We can even use this method to move elements around the document.