RE: How can DOM possibly contain a document?


The DOM in script would look something like this:

var oStrong = document.createElement('STRONG')
var oText1 = document.createTextNode('Hello, ')
var oI = document.createElement('I')
var oText2 = document.createTextNode('I\'m ')
var oText3 = document.createTextNode('doing fine')


As you can see, the STRONG element has three childNodes, a text node, an I
node(which contains a text node), and another text node.

I think the part you are missing is that the text in the STRONG element are
nodes themselves.

Hope this helps.



> -----Original Message-----
> From: Bernard Miller []
> Sent: Wednesday, March 22, 2000 8:01 PM
> To:
> Subject: How can DOM possibly contain a document?
> Let's say you have a simple nested tag like:
> <STRONG>Hello, <I>I'm </I>doing fine</STRONG>
> I'm having a hard time understanding how one can use
> any combination of DOM functionality to reconstruct a
> document with nested tags. In my primitive
> understanding, the nested tag element is a child
> object and as far as I can tell you can query the
> parent for WHAT the child is, and in what order the
> child appears among other children, but not WHERE it
> is in the text of the parent. Please enlighten me.
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.

Received on Thursday, 23 March 2000 08:53:05 UTC