TOC PREV NEXT INDEX

Put your logo here!


appendChild


The appendChild method inserts the specified node into the list of nodes on the current document.

Syntax

document.appendChild(newChild) 

Parameters

newChild is a node.

Example

// puts the new, empty paragraph at the end 
// of the document 
p = document.createElement("p"); 
document.appendChild(p); 

Notes

appendChild is one of the fundamental methods of web programming using the DOM. The appendChild method inserts a new node into the DOM structure of the HTML document, and is the secon part of the one-two, create-and-append process so central to building web pages programmatically. The example above illustrates this basic process.

Specification

core


mozilla.org | mailto:oeschger | bug 93108
TOC PREV NEXT INDEX