Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CreateElement / addChildNodes

 
Bram Maes
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

My code looks like this :



What I see now is that alle the elements get separately added when I execute the createElement statements and they to the document while I only want the e1 element added (that has the other elements as children).

I'm sure there must be a simple way to do this but for the moment I don't see it. Can someone please help?

thanks.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try adding e1 to the Document right after creating it.

Bill
 
Bram Maes
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That did the trick indeed. This doesn't feel really naturally to me... Guess I'm the only one having this feeling

thanks a lot.
regards,
Bram.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic