HTML DOM removeChild() method
Example
Remove a node from the list of child nodes:
var list=document.getElementById("myList");
list.removeChild(list.childNodes[0]);
Before removing:
- Coffee
- Tea
- Milk
After removing:
- Tea
- Milk
Try it »
Definition and Usage
The removeChild() method removes a node from the list of child nodes.
If the removal succeeds, this method returns the removed node; if it fails, it returns NULL.
Browser support





All major browsers support the removeChild method
Syntax
node
.removeChild(
node
)
Parameters
| Parameters | Type | Description |
|---|---|---|
| node | Node object | Required. The node object you want to remove. |
Return Value
| Type | Description |
|---|---|
| Node object | The removed node |
Technical Details
| DOM version | Core Level 1 Node Object |
|---|
Element object