|
|
|
|
|
replaceChild
The replaceChild() method replaces one child node on the current element with another.
Syntax
element.replaceChild(oldChild, newChild)Parameters
oldChild is the existing child node to be replaced.
Example
// <div id="top" align="left"> // <div id="in">in</div> // </div> d1 = document.getElementById("top"); d_new = document.createElement("p"); d1.replaceChild(d1, d_new); alert(d1.childNodes[0].tagName)
Notes
Specification
core
| mozilla.org | mailto:oeschger | bug 93108 |
|
|
|
|
|