JavaScript DHTML/Node Operation/replaceNode

Материал из Web эксперт
Перейти к: навигация, поиск

"replaceNode()" Example

   <source lang="html4strict">
   

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