Web server info - CD-378 Part VI . Appendixes createTextNode( text ) NN2 NN3
CD-378 Part VI . Appendixes createTextNode( text ) NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility Example While Chapter 14 and 15 (Listing 15-21, for instance) provide numerous examples of the createTextNode()method at work, using The Evaluator (Chapter 13) is instructive to see just what the method generates in IE5+ and NN6. You can use one of the built-in global variables of The Evaluator to hold a reference to a newly generated text node by entering the following statement into the top text field: a = document.createTextNode( Hello ) The Results box shows that an object was created. Now, look at the properties of the object by typing a into the bottom text field. The precise listings of properties varies between IE5+ and NN6, but the W3C DOM properties that they share in common indicate that the object is a node type 3 with a node name of #text. No parents, children, or siblings exist yet because the object created here is not part of the document hierarchy tree until it is explicitly added to the document. To see how insertion works, enter the following statement into the top text field to append the text node to the myPparagraph: document.getElementById( myP ).appendChild(a) The word Hello appears at the end of the simple paragraph lower on the page. Now you can modify the text of that node either via the reference from the point of view of the containing P element or via the global variable reference for the newly created node: document.getElementById( myP ).lastChild.nodeValue = Howdy or a.nodeValue = Howdy document.createTextNode()
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.