JavaScript DHTML/Javascript Objects/TextNode

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

"TextNode" Example

   <source lang="html4strict">
   

<html> <head> <script> function replaceText(){

   var myTextNode = document.createTextNode("Text was replaced");
   var newTN = replaceMe.firstChild.replaceNode(myTextNode); 

} </script> </head>

This is some text that will be replaced

<button onclick="replaceText();">Replace text</button> </body> </html>


     </source>