The MSIE browser models the document as a collection of nodes. Clearly, an HTML tag corresponds to an object. However, what isn't so obvious is that the text in between HTML tags is collected together and represented by a textNode object.

These textNodes are generally accessible as child objects belonging to an object instantiated by an HTML tag.

For example:

AAA<P>BBB<P>CCC

can be accessed as follows:

The <P> tags are objects which are members of the document.getElementsByTagName("P") collection. The text "BBB" is referenced through the firstChild property of the P object instantiated by the first <P> tag. The text "CCC" is a textNode object referenced via the firstChild property of the second <P> tag.

The DOM level 3 specification is expected to add the following method to the textNode object: