JavaScript Reference/Javascript Methods/replaceNode — различия между версиями

Материал из Web эксперт
Перейти к: навигация, поиск
 
м (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>

Sample
   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>                                                   |
      |                |                             
        | | | <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>

      |

      | |<textarea> <tfoot> |

      | |
      <thead> | | |