JavaScript Reference/Javascript Methods/createTextNode

Материал из Web эксперт
Версия от 11:22, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

"createTextNode()" Example

   <source lang="javascript">
   

<html> <body> <script language="JavaScript"> function function11() {

  var myNode = document.createTextNode("New Text Node");
  document.body.appendChild(myNode); 

} </script> <button onclick="function11();">Create text node</button> </body> </html>


     </source>
   
  


"createTextNode()" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |document | +----------------+--------------------------------------------------------------+

     </source>
   
  


"createTextNode()" Syntax, Parameters and Note

   <source lang="javascript">

Note: Creates a new text node.

Syntax:

document.createTextNode(param1) Parameters:

   param1   Optional; the nodeValue property value. 
   
     
     </source>