hi, everyone
i would like to learn more about parentnode and childnode (with exaplanation) with the tutorials
The reason i am beginner i dont understand this properties
does anyone help

Recommended Answers

First, you must understand HTML/XHTML and Javascript. Otherwise you will be trying to run before you can walk.

Then, get your mind round the fact the the Document Object Model (DOM) is a tree structure and learn a few special Javascript commands to address and manipulate the DOM.

Jump to Post

All 3 Replies

Well an HTML page is laid out like a tree.

/*
        HEAD
         |
        BODY
          \
           DIV  <-- SPAN's parent node
            \
            SPAN
            /  \
          A   IMG <-- SPAN's child nodes

Each point in the tree is called a Node. The Node directly above another in the tree is its parent (just like a family tree). Any node directly below another is a child

thank you very much
i understood
but i would like to see it a live example
if possible

First, you must understand HTML/XHTML and Javascript. Otherwise you will be trying to run before you can walk.

Then, get your mind round the fact the the Document Object Model (DOM) is a tree structure and learn a few special Javascript commands to address and manipulate the DOM.

There's little point posting examples here as there are several online tutorials which do a much better job. This is one from W3Schools, or stick "DOM Tutorial" or similar into Google.

Airshow

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.