AvailabilityDOM Level 1 Core SynopsisNode removeChild(Node oldChild) throws DOMException; Arguments
ReturnsThe node that was removed. ThrowsThis method may throw a DOMException with the following code values in the following circumstances:
DescriptionThis method removes the specified child from the childNodes[] array of this node. It is an error to call this method with a node that is not a child. removeChild( ) returns the oldChild node after removing it. oldChild continues to be a valid node and may be reinserted into the document later. ExampleYou can delete the last child of the document body with this code: document.body.removeChild(document.body.lastChild); See AlsoNode.appendChild( ), Node.insertBefore( ), Node.replaceChild( ) |