JavaScript Tutorial/DOM Node/createTextNode
Версия от 21:52, 25 мая 2010; (обсуждение)
Create a TextNode
<source lang="javascript">
<html> <head> <title>appendChild() Example</title> <script type="text/javascript">
function appendMessage() { var oNewP = document.createElement("p"); var oText = document.createTextNode("www.wbex.ru"); oNewP.appendChild(oText); document.body.appendChild(oNewP); }
</script> </head> <body onload="appendMessage()">
Hello World!
</body> </html></source>