Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] javascript DOM doubt


  • From: jens.brueckmann at gmail.com (Jens Brueckmann)
  • Subject: [Javascript] javascript DOM doubt
  • Date: Fri Aug 25 05:01:11 2006

Hi Suresh,

> suppose i am already having a parent node and the child node.i want to
> append a another child node below the already available child node.
>
>
>          <div id='iedisplayarea'>     //parent node
>                      |
>                      |
>              <img id='ashow'>              //child node of iedisplay area
>                      |
>                      |
>              <img id='ashow1'>            //child node of ashow

This tree is the root of your problem. The content model of the IMG
element is empty. Thus, IMG can not have any children.
In your tree, "ashow1" can not be a child of "ashow", it is a sibling.
The IMG element you want to append becomes a child of the parent
element, which is "iedisplayarea".

Change the following line of your code accordingly to:

  var x = document.getElementById('iedisplayarea');

Cheers,

jens

-- 
Jens Brueckmann
http://www.yalf.de