JavaScript Reference/Javascript Methods/createTextNode

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

"createTextNode()" Example

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



"createTextNode()" is applied to

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



"createTextNode()" Syntax, Parameters and Note

Note:
Creates a new text node.
    
Syntax:
    
document.createTextNode(param1)
Parameters:
    param1   Optional; the nodeValue property value.