From 8043206c9ecbb8a8c98456367958ced646ab4732 Mon Sep 17 00:00:00 2001 From: Olmo Maldonado Date: Thu, 28 Oct 2010 23:15:57 -0500 Subject: [PATCH] Cleaned adopt example which if run through command line, would not work (myParent are missing). --- Docs/Element/Element.md | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/Docs/Element/Element.md b/Docs/Element/Element.md index 9488e1d2..bebe38af 100644 --- a/Docs/Element/Element.md +++ b/Docs/Element/Element.md @@ -631,27 +631,26 @@ Inserts the passed element(s) inside the Element (which will then become the par ##### JavaScript - var myFirstElement = new Element('div', {id: 'myFirstElement'}); - var mySecondElement = new Element('a', {id: 'mySecondElement'}); - var myThirdElement = new Element('ul', {id: 'myThirdElement'}); + var myFirstElement = new Element('div#first'); + var mySecondElement = new Element('p#second'); + var myThirdElement = new Element('ul#third'); + var myFourthElement = new Element('a#fourth'); + + var myParentElement = new Element('div#parent'); + + myFirstElement.adopt(mySecondElement); + mySecondElement.adopt('third', myFourthElement); - myParent.adopt(myFirstElement); - myParent2.adopt(myFirstElement, 'mySecondElement'); - myParent3.adopt([myFirstElement, mySecondElement, myThirdElement]); + myParent3.adopt([myFirstElement, new Element('span#another')]); ##### Resulting HTML -
-
-
-
-
- -
-
-
- -