Messing With My Head
It is currently Fri Aug 23, 2019 10:22 am

All times are UTC - 8 hours

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Javascript: nodes and children
PostPosted: Thu Apr 14, 2011 2:35 pm 
Site Admin

Joined: Thu Sep 02, 2004 7:45 am
Posts: 39
It appears that most BLOCK-level elements (<p>, <h1>, etc.) can NOT be nested and then explored for children. For example:

<h1>Parent 1
<h1>Child 1</h1> </h1>

does NOT create a parent/child relationship. "Parent 1" has NO child elements.

<h1>Parent 1
<span>Child 1</span> </h1>

DOES create a parent/child relationship, because the nested element (span) is not block-level.

"Parent 1" has 1 child element in MSIE, and 3 child elements in Firefox, because Firefox treats whitespace as nodes of the type '#text'.

Here is an exception to the block-level rule:

<div>Parent 1
<div>Child 1</div> </div>

The DIV element, which is typically block-level, CAN be used in a parent/child relationship with other DIV elements.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 8 hours

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  


Original content is Copyright ©2004-2011 by James Butler. All rights reserved.
ThinkTinker is a trademark protected under United States trademark law.


In addition to the "Rules of the Road", visitors who contribute to this website agree to the following:
The author of a comment releases all copyrights with respect to the contents of the comment.
Comments may be edited, moved or deleted at any time for any reason at the sole discretion of James Butler.
Any parts of this Bulletin Board may be re-published and/or compiled in any form
at any time without further notice, compensation or acknowledgement.
(We will try to keep attributions intact, but we make no guarantees.)
If you do not agree to all of the above Terms & Conditions, do not post anything on this Bulletin Board.

ThinkTinker's Administrator may be reached by email: james at

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group