Re: Moving DOM Nodes

Frederic JECKER
Wed, 19 Sep 2007 12:20:33 -0000

Hi,

After further working/searching I found a solution, below an example:

 var tomove=$(div);

        if(tomove.parentNode!=null &amp;&amp;
tomove.parentNode.id!=''glassPane''){

            var clone=tomove.cloneNode(true);

            $(''glassPane'').appendChild(clone);

            var objBody =
document.getElementsByTagName(''body'').item(0);

            objBody.removeChild(tomove);

        }

RobG a écrit :

On Sep 19, 8:10 pm, Frederic JECKER  wrote:

Moin List,

Is there a "simple" way for moving DOM nodes and insert them into
another DOM part ?
Example: Moving a DIV into another DIV.
I''m actually using prototype Insertion to manage to do this but this
solution doesn''t satisfies me.

Assign the node you want to move as a child of the node you want to
make it a child of, e.g.

 A 1
 A 2

 B 1
 B 2

--
Rob

--

      Frédéric
JECKER

GIP Sym@ris

Pavillon 1

27 rue du 4ème RSM B.P. 29

F-68250  ROUFFACH

      Tél : +33 (0)3 89
78 79
02

      Fax : +33 (0)3 89
78 79 00

      Courriel :
      f.jecker-Y0KRaRJ5EAdBDgjK7y7TUQ@public.gmane.org

      Web : http://www.symaris.com

      PFaites
un geste pour l''environnement - avez vous réellement besoin
d''imprimer
ce courriel ?

      PPlease
consider the environment - do you really need to print this email ?