Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - DOM Developer's Guide

Getting and Setting Data Within a Node

Data marked up as text within elements, attributes, comments, and processing instructions is exposed in the Document Object Model (DOM) as node values.

The following code sets the value of an attribute to "hello world".

newAttNode = myElementNode.createAttribute("newAtt")
newAttNode.nodeValue = "hello world"

There are three ways to access text within an element node.

See Also

dataType Property | nodeValue Property | nodeTypedValue Property | text Property