removeChild (W3C DOM Core method)

Spec
Version Depr. Static
DOM1 No No
Browser support (more…)
IE5.5+ FF1.5+ SA1.3+ OP9+
Full Full Full Full
Returns
Node
Throws
NO_MODIFICATION_ALLOWED_ERR, NOT_FOUND_ERR

Example

node.removeChild(oldnode);

The example above will remove oldnode from node's list of children.

So if node is actually an HTML <p> element, and oldnode is an em inside it:

<p>Love <em>always</em> wins.</p>

The remove operation would result in this:

<p>Love  wins.</p>

Arguments

old node (Node) required

The node to be removed.

Description

Removes a specified node from the children of this node.

Return value

The node that was removed

Compatibility

Internet Explorer Firefox Safari Opera
5.5 6.0 7.0 1.5 2.0 3.0 1.3 2.0 3.0 9.0 9.5
Full Full Full Full Full Full Full Full Full Full Full

No known issues.

User-contributed notes

There are no comments yet.

Related Products