I am just starting to learn DOMs so that I can alter my page with javascripts. I am reading that text nodes can not have children. I am confused by two things. What is considered a text node? In the example from the brainjar website they call <p id="sample1"> blah blah </p> a text node. Is <div id="sample">blah blha </div> a text node?
I use <div> to contain all my text. If <div> is a text node in that case, then doesn't nested <div>s mean the nested <div> is a child. For example:
<div id="parent">
<div id="child">blah</div>
</div>
Doesn't the parent node have a child node in this case? or are <div>s handled differently. Again I am a newbie, but I am trying to learn as much, and as fast as possible.
I use <div> to contain all my text. If <div> is a text node in that case, then doesn't nested <div>s mean the nested <div> is a child. For example:
<div id="parent">
<div id="child">blah</div>
</div>
Doesn't the parent node have a child node in this case? or are <div>s handled differently. Again I am a newbie, but I am trying to learn as much, and as fast as possible.
Comment