document.createElement()

The DOM method that creates a new, detached element with a given tag name, ready to be filled in and inserted into the page.

In more detail

The new element exists only in memory until you insert it with appendChild or a similar method. The course examples build a throwaway document with document.implementation.createHTMLDocument() and create elements inside it.

Related terms

Taught in

References