- createTextNode(nodeName)
-
JavaScript DOM Method: createTextNode
Creates a new Text node.
text = document.createTextNode(data)
textis a Text node.datais a string containing the data to be put in the text node.
<html>http://www.sunsite.ubc.ca/LatinDictionary/ <head> <title>createTextNode example</title> <script type="text/javascript"> function addTextNode() { var newtext = document.createTextNode(" Some text added dynamically. "); var para = document.getElementById("p1"); para.appendChild(newtext); } </script> </head> <body> <div style="border: 1px solid red"> <p id="p1">First line of paragraph.<br /></p> </div><br /> <button onclick="addTextNode();">add another textNode.</button> </body> </html>View createTextNode listing in the w3c DOM Level 2 Core
This reference originally retrieved from “http://developer.mozilla.org/en/docs/DOM:document.createTextNode“See Also: The W3C DOM2 Core Reference Root, where other JavaScript Methods, like the one described here, are indicated with a light-blue, inline background colour.
NoviceNotes.Paged
- A Web Developer Resource
- .js – A Quick Ref
- .js – DOM Methods
- .js – Statements
- Character Encodings – HTML Entities – NCR – Unicode – ASCII – i18n
- CSS : One-Shots
- CSS: Visual Format
- My life, MySQL and Me
- Perspective on Design:
- PHP – Greatest Hits Vol. I
- RegEx / RegExp / Regular Expressions
- Tidy: Quick Reference
- Valid · XHTML · HTML
- Adventures in Character Encoding
- Regular Expressions :
PCRE and POSIX RegEx Solutions - CSS: White-Space & Content
- Data Recovery
- Glossary of Terms
- Software (Quick Notes)
- Software – Cross-Platform
- Software – Linux
- Software – Windows®
- WWW University
- Zen of the About Page
Leave a Reply
You must be logged in to post a comment.