Met Node Replacechild
# HTML DOM replaceChild() Method
[ Element Object](#)
## Example
Replace a child node with another:
document.getElementById("myList").replaceChild(_newnode_,_oldnode_);
Before removal:
* Coffee
* Tea
* Milk
After removal:
* Water
* Tea
* Milk
[Try it Yourself Β»](#)
* * *
## Definition and Usage
The replaceChild() method replaces a child node with another node.
The new node can be one that already exists in the document, or a newly created node.
* * *
## Browser Support

The replaceChild() method is supported by all major browsers.
* * *
## Syntax
_node_.replaceChild(_newnode_,_oldnode_)
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| _newnode_ | Node object | Required. The node object you want to insert. |
| _oldnode_ | Node object | Required. The node object you want to remove. |
## Return Value
| Type | Description |
| --- | --- |
| Node object | The replaced node. |
## Technical Details
| DOM Version | Core Level 1 Node Object |
| --- |
* * Element Object](#)
YouTip