JavaScript Reference/Javascript Methods/replaceNode — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 11:22, 26 мая 2010
"replaceNode()" Example
<source lang="javascript">
<html> <body> <script language="JavaScript"> function function1() {
var newElement = document.createElement("u"); newElement.innerHTML = "Text"; var oldElement = document.all.myBold; document.all.myBold.replaceNode(newElement);
} </script> <button onclick="function1();">Replace text</button>
text
</body> </html>
</source>
"replaceNode()" is applied to
<source lang="javascript">
+----------------+--------------------------------------------------------------+ | Applied_To |<a> <acronym> | | |<address> | | | |
| |<body> || |<button>
| | | | | |
| |<col> | | |<colgroup> <comment> | | |
| | | <dir> ||
| |
- | | |<fieldset> | | |<form> <frameset> | | |<head> <hn> | | |<html> | | |<iframe> <input type="button"> | | |<input type="checkbox"> <input type="file"> | | |<input type="image"> <input type="password"> | | |<input type="radio"> <input type="reset"> | | |<input type="submit"> <input type="text"> | | | | | |<label> <legend> | | |
- <listing> | | |<map> <marquee> | | |<menu> <object> | | |
<option> | | |
<plaintext> | | |
| | || | |<select> | | || | | | | || | |<tbody>
| | |<textarea> <tfoot> |
| |<thead> | | | | | | | | | <xmp> | +----------------+--------------------------------------------------------------+ </source>
"replaceNode()" Syntax, Parameters and Note
<source lang="javascript"> Note: Replaces an node with a new node.
Syntax:
document.all.elementID.replaceNode(param1) Parameters: param1 Required; the replacement node.
</source>