Add SauceLabs browsers badge
[mootools.git] / Docs / Element / Element.md
blob2bbcc6e7c732a62041f249b54ad8cbc1bec2b2be
1 Type: Window {#Window}
2 ======================
4 The following functions are treated as Window methods.
6 Function: document.id {#Window:document-id}
7 -------------------------------------------
9 The document.id function has a dual purpose: Getting the element by its id, and making an element in Internet Explorer "grab" all the [Element][] methods.
11 ### Syntax:
13         var myElement = document.id(el);
15 ### Arguments:
17 1. el - The Element to be extended. Can be one of the following types:
18         * (*element*) The element will be extended if it is not already.
19         * (*string*) A string containing the id of the DOM element desired.
20         * (*object*) If the object has a toElement method, toElement will be called to get the Element.
22 ### Returns:
24 * (*element*) A DOM element.
25 * (*null*) Null if no matching id was found or if toElement did not return an element.
27 ### Examples:
29 #### Get a DOM Element by ID:
31         var myElement = document.id('myElement');
33 #### Get a DOM Element by reference:
35         var div = document.getElementById('myElement');
36         div = document.id(div); // the element with all the Element methods applied.
38 ### Notes:
40 - This method is useful when it's unclear if working with an actual element or an id.  It also serves as a shorthand for document.getElementById().
41 - In Internet Explorer, the [Element][] is extended the first time document.id is called on it, and all the [Element][] Methods become available.
42 - Browsers with native HTMLElement support, such as Safari, Firefox, and Opera, apply all the [Element][] Methods to every DOM element automatically.
43 - Because MooTools detects if an element needs to be extended or not, this function may be called on the same Element many times with no ill effects.
46 Function: $ {#Window:dollar}
47 ----------------------------
49 The dollar function is an alias for [document:id][] if the $ variable is not set already.
50 However it is not recommended to use more frameworks, the $ variable can be set by another framework or script. MooTools will detect this and determine if it will set the $ function so it will not be overwritten.
52 ### Examples:
54         var myElement = $('myElement');
55         var myElement2 = document.id('myElement');
57         myElement == myElement2; // returns true
60         (function($){
62                 // Now you can use $ safely in this closure
64         })(document.id)
67 ### See Also:
68  - MooTools Blogpost: [The Dollar Safe Mode][]
71 Function: $$ {#Window:dollars}
72 ------------------------------
74 Selects and extends DOM elements. Return an Elements instance.
75 The Element instance returned is an array-like object, supporting every [Array][] method and every [Element][] method.
77 ### Syntax:
79         var myElements = $$(argument);
81 ### Arguments:
83 * selector - (*string*) A CSS selector
84 * elements - (*elements*), (*collection*) or (*array*) An enumerable list of elements
85 * element, element - (*element*) any number of elements as arguments
87 ### Returns:
89 * (*elements*) - An array-like Elements collection of all the DOM elements matched, extended with [document:id][].
91 ### Examples:
93 #### Get Elements by Their Tag Names:
95         $$('a'); // returns all anchor elements in the page.
97 #### Get an Elements instance by passing multiple elements:
99         $$(element1, element2, element3); // returns an Elements instance containing these 3 elements.
101 #### Convert any array or collection of elements to an Elements instance:
103         $$([element1, element2, element3]); // returns an Elements instance containing these 3 elements.
104         $$(document.getElementsByTagName('a')); // returns an Elements instance containing the result of the getElementsByTagName call.
106 #### Using CSS Selectors:
108         $$('#myElement'); // returns an Elements instance containing only the element with the id 'myElement'.
109         $$('#myElement a.myClass'); // returns an Elements instance of all anchor tags with the class 'myClass' within the DOM element with id 'myElement'.
110         $$('a, b'); // returns an array of all anchor and bold elements in the page.
112 ### Notes:
114 - Since MooTools 1.3 this function does not accept multiple collections or multiple strings as arguments.
115 - If an expression doesn't find any elements, an empty Elements instance will be returned.
116 - The return type of element methods run through [$$][] is always an Elements instance, regardless of the amount of results.
117 - Default Selectors supported are the same as you can find on [W3C CSS3 selectors](http://www.w3.org/TR/css3-selectors/#selectors).
120 Type: Element {#Element}
121 ========================
123 Custom Type to allow all of its methods to be used with any extended DOM Element.
127 Element Method: constructor {#Element:constructor}
128 --------------------------------------------------
130 Creates a new Element of the type passed in.
132 ### Syntax:
134         var myEl = new Element(element[, properties]);
136 ### Arguments:
138 1. element - (*mixed*) The tag name for the Element to be created or an actual DOM element or a CSS selector.
139 2. properties - (*object*, optional) Calls the Single Argument version of [Element:set][] with the properties object passed in.
141 ### Returns:
143 * (*element*) A new MooTools extended HTML Element.
145 ### Examples:
147         // Creating an new anchor with an Object
148         var myAnchor = new Element('a', {
149                 href: 'http://mootools.net',
150                 'class': 'myClass',
151                 html: 'Click me!',
152                 styles: {
153                         display: 'block',
154                         border: '1px solid black'
155                 },
156                 events: {
157                         click: function(){
158                                 alert('clicked');
159                         },
160                         mouseover: function(){
161                                 alert('mouseovered');
162                         }
163                 }
164         });
166         // Using Selectors
167         var myNewElement = new Element('a.myClass');
169 ### Note:
171 Because the element name is parsed as a CSS selector, colons in namespaced tags have to be escaped. So `new Element('fb\:name')` becomes `<fb:name>`.
173 ### See Also:
175 - [$][], [Element:set][]
179 Element Method: getElement {#Element:getElement}
180 ------------------------------------------------
182 Gets the first descendant element whose tag name matches the tag provided. CSS selectors may also be passed.
184 ### Syntax:
186         var myElement = myElement.getElement(tag);
188 ### Arguments:
190 1. tag - (*string*) Tag name of the element to find or a CSS Selector.
192 ### Returns:
194 * (*mixed*) If a match is found, the Element will be returned. Otherwise, returns null.
196 ### Examples:
198         var firstDiv = $(document.body).getElement('div');
200 ### Notes:
202 - This method is also available for Document instances.
203 - Default Selectors supported are the same as you can find on [W3C CSS3 selectors](http://www.w3.org/TR/css3-selectors/#selectors).
207 Element Method: getElements {#Element:getElements}
208 --------------------------------------------------
210 Collects all descendant elements whose tag name matches the tag provided. CSS selectors may also be passed.
212 ### Syntax:
214         var myElements = myElement.getElements(tag);
216 ### Arguments:
218 1. tag - (*string*) String of the tag to match  or a CSS Selector.
220 ### Returns:
222 * (*array*) An [Elements][] array of all matched Elements.
224 ### Examples:
226         var allAnchors = $(document.body).getElements('a');
228 ### Notes:
230 - This method is also available for Document instances.
231 - Default Selectors supported are the same as you can find on [W3C CSS3 selectors](http://www.w3.org/TR/css3-selectors/#selectors).
235 Element Method: getElementById {#Element:getElementById}
236 --------------------------------------------------------
238 Gets the element with the specified id found inside the current Element.
240 ### Syntax:
242         var myElement = anElement.getElementById(id);
244 ### Arguments:
246 1. id - (*string*) The ID of the Element to find.
248 ### Returns:
250 * (*mixed*) If a match is found, returns that Element. Otherwise, returns null.
252 ### Examples:
254         var myChild = $('myParent').getElementById('myChild');
256 ### Notes:
258 - This method is not provided for Document instances as document.getElementById is provided natively.
262 Element Method: set {#Element:set}
263 ----------------------------
265 This is a "dynamic arguments" method. Properties passed in can be any of the 'set' properties in the [Element.Properties][] Object.
267 ### Syntax:
269         myElement.set(arguments);
271 ### Arguments:
273 - Two Arguments (property, value)
274         1. property - (*string*) The string key from the [Element.Properties][] Object representing the property to set.
275         2. value - (*mixed*) The value to set for the specified property.
276 - One Argument (properties)
277         1. properties - (*object*) Object with its keys/value pairs representing the properties and values to set for the Element (as described below).
279 ### Returns:
281 * (*element*) This Element.
283 ### Examples:
285 #### With Property and Value:
287         $('myElement').set('text', 'text goes here');
288         $('myElement').set('class', 'active');
289         // the 'styles' property passes the object to Element:setStyles.
290         var body = $(document.body).set('styles', {
291                 font: '12px Arial',
292                 color: 'blue'
293         });
295 #### With an Object:
297         var myElement = $('myElement').set({
298                 // the 'styles' property passes the object to Element:setStyles.
299                 styles: {
300                         font: '12px Arial',
301                         color: 'blue',
302                         border: '1px solid #f00'
303                 },
304                 // the 'events' property passes the object to Element:addEvents.
305                 events: {
306                         click: function(){ alert('click'); },
307                         mouseover: function(){ this.addClass('over'); }
308                 },
309                 //Any other property uses Element:setProperty.
310                 id: 'documentBody'
311         });
313 ### Notes:
315 - All the property arguments are passed to the corresponding method of the [Element.Properties][] Object.
316 - If no matching property is found in [Element.Properties][], it falls back to [Element:setProperty][].
317 - Whenever using [Element:setProperty][] to set an attribute, pass in the lowercase, simplified form of the property. For example:
318         - use 'for', not 'htmlFor',
319         - use 'class', not 'className'
320         - use 'frameborder', not 'frameBorder'
321         - etc.
322 - In IE8 or lower, it is not possible to set `type` multiple times. It will throw an error.
325 ### See Also:
327 - [Element][], [Element.Properties][], [Element:setProperty][], [Element:addEvents][], [Element:setStyles][]
331 Element Method: get {#Element:get}
332 ----------------------------------
334 This is a "dynamic arguments" method. Properties passed in can be any of the 'get' properties in the [Element.Properties][] Object.
336 ### Syntax:
338         myElement.get(property);
340 ### Arguments:
342 1. property - (*string*) The string key from the [Element.Properties][] Object representing the property to get.
344 ### Returns:
346 * (*mixed*) The result of calling the corresponding 'get' function in the [Element.Properties][] Object.
348 ### Examples:
350 #### Using Custom Getters:
352         var tag = $('myDiv').get('tag'); // returns "div".
354 #### Fallback to Element Attributes:
356         var id = $('myDiv').get('id'); // returns "myDiv".
357         var value = $('myInput').get('value'); // returns the myInput element's value.
359 ### Notes:
361 -  If the corresponding accessor doesn't exist in the [Element.Properties][] Object, the result of [Element:getProperty][] on the property passed in is returned.
363 ### See Also:
365 - [Element][], [Element.Properties][], [Element:getProperty][]
369 Element Method: erase {#Element:erase}
370 --------------------------------------
372 This is a "dynamic arguments" method. Properties passed in can be any of the 'erase' properties in the [Element.Properties][] Object.
374 ### Syntax:
376         myElement.erase(property);
378 ### Arguments:
380 1. property - (*string*) The string key from the [Element.Properties][] Object representing the property to erase.
382 ### Returns:
384 * (*mixed*) The result of calling the corresponding 'erase' function in the [Element.Properties][] Object.
386 ### Examples:
388         $('myDiv').erase('id'); //Removes the id from myDiv.
389         $('myDiv').erase('class'); //myDiv element no longer has any class names set.
391 ### Note:
393 -  If the corresponding eraser doesn't exist in the  [Element.Properties][] Object, [Element:removeProperty][] is called with the property passed in.
395 ### See Also:
397 - [Element][], [Element.Properties][], [Element:removeProperty][]
401 Element Method: match {#Element:match}
402 --------------------------------------
404 Tests this Element to see if it matches the argument passed in.
406 ### Syntax:
408         myElement.match(match);
410 ### Arguments:
412 1. match - can be a string or element
413         - (*string*) The tag name to test against this element. Any single CSS selectors may also be passed.
414         - (*element*) An element to match; returns true if this is the actual element passed in.
416 ### Returns:
418 * (*boolean*) If the element matched, returns true. Otherwise, returns false.
420 ### Examples:
422 #### Using a Tag Name:
424         // returns true if #myDiv is a div.
425         $('myDiv').match('div');
427 #### Using a CSS Selector:
429         // returns true if #myDiv has the class foo and is named "bar"
430         $('myDiv').match('.foo[name=bar]');
432 #### Using an Element:
434         var el = $('myDiv');
435         $('myDiv').match(el); // returns true
436         $('otherElement').match(el); // returns false
440 Element Method: contains {#Element:contains}
441 --------------------------------------------
443 Checks all descendants of this Element for a match.
446 ### Syntax:
448         var result = myElement.contains(el);
450 ### Arguments:
452 1. el - (*element*) The element to search for.
454 ### Returns:
456 * (*boolean*) Returns true if the element contains passed in Element is a child, otherwise false.
458 ### Examples:
460 ##### HTML
462         <div id="Darth_Vader">
463                 <div id="Luke"></div>
464         </div>
466 ##### JavaScript
468         if ($('Darth_Vader').contains($('Luke'))) alert('Luke, I am your father.'); //tan tan tannn...
472 Element Method: inject {#Element:inject}
473 ----------------------------------------
475 Injects, or inserts, the Element at a particular place relative to the Element's children (specified by the second the argument).
477 ### Syntax:
479         myElement.inject(el[, where]);
481 ### Arguments:
483 1. el   - (*mixed*) el can be the id of an element or an element.
484 2. where - (*string*, optional: defaults to 'bottom') The place to inject this Element.  Can be 'top', 'bottom', 'after', or 'before'.
486 ### Returns:
488 * (*element*) This Element.
490 ### Examples:
492 ##### JavaScript
494         var myFirstElement  = new Element('div', {id: 'myFirstElement'});
495         var mySecondElement = new Element('div', {id: 'mySecondElement'});
496         var myThirdElement  = new Element('div', {id: 'myThirdElement'});
498 ##### Resulting HTML
500         <div id="myFirstElement"></div>
501         <div id="mySecondElement"></div>
502         <div id="myThirdElement"></div>
504 #### Inject to the bottom:
506 ##### JavaScript
508         myFirstElement.inject(mySecondElement);
510 ##### Resulting HTML
512         <div id="mySecondElement">
513                 <div id="myFirstElement"></div>
514         </div>
516 #### Inject to the top:
518 ##### JavaScript
520         myThirdElement.inject(mySecondElement, 'top');
522 ##### Resulting HTML
524         <div id="mySecondElement">
525                 <div id="myThirdElement"></div>
526                 <div id="myFirstElement"></div>
527         </div>
529 #### Inject before:
531 ##### JavaScript
533         myFirstElement.inject(mySecondElement, 'before');
535 ##### Resulting HTML
537         <div id="myFirstElement"></div>
538         <div id="mySecondElement"></div>
540 #### Inject After:
542 ##### JavaScript
544         myFirstElement.inject(mySecondElement, 'after');
546 ##### Resulting HTML
548         <div id="mySecondElement"></div>
549         <div id="myFirstElement"></div>
551 ### See Also:
553 [Element:adopt](#Element:adopt), [Element:grab](#Element:grab), [Element:wraps](#Element:wraps)
557 Element Method: grab {#Element:grab}
558 ------------------------------------
560 Works as [Element:inject](#Element:inject), but in reverse.
562 Appends the Element at a particular place relative to the Element's children (specified by the where parameter).
564 ### Syntax:
566         myElement.grab(el[, where]);
568 ### Arguments:
570 1. el - (*mixed*) el can be the id of an element or an Element.
571 2. where - (*string*, optional: default 'bottom') The place to append this Element. Can be 'top', 'bottom', 'before' or 'after'.
573 ### Returns:
575 * (*element*) This Element.
577 ### Examples:
579 ##### HTML
581         <div id="first">
582                 <div id="child"></div>
583         </div>
585 ##### JavaScript
587         var mySecondElement = new Element('div#second');
588         $('first').grab(mySecondElement);
590 ##### Resulting HTML
592         <div id="first">
593                 <div id="child"></div>
594                 <div id="second"></div>
595         </div>
597 ##### JavaScript
599         var mySecondElement = new Element('div#second');
600         myFirstElement.grab(mySecondElement, 'top');
602 ##### Resulting HTML
604         <div id="first">
605                 <div id="second"></div>
606                 <div id="child"></div>
607         </div>
609 ### See Also:
611 [Element:adopt](#Element:adopt), [Element:inject](#Element:inject), [Element:wraps](#Element:wraps)
615 Element Method: adopt {#Element:adopt}
616 --------------------------------------
618 Works like [Element:grab](#Element:grab), but allows multiple elements to be adopted and only appended at the bottom.
620 Inserts the passed element(s) inside the Element (which will then become the parent element).
622 ### Syntax:
624         myParent.adopt(el[, others]);
626 ### Arguments:
628 1. el - (*mixed*) The id of an element, an Element, or an array of elements.
629 2. others - (*mixed*, optional) One or more additional Elements separated by a comma or as an array.
631 ### Returns:
633 * (*element*) This Element.
635 ### Examples:
637 ##### JavaScript
639         var myFirstElement  = new Element('div#first');
640         var mySecondElement = new Element('p#second');
641         var myThirdElement  = new Element('ul#third');
642         var myFourthElement = new Element('a#fourth');
644         var myParentElement = new Element('div#parent');
646         myFirstElement.adopt(mySecondElement);
647         mySecondElement.adopt(myThirdElement, myFourthElement);
648         myParentElement.adopt([myFirstElement, new Element('span#another')]);
650 ##### Resulting HTML
652         <div id="parent">
653                 <div id="first">
654                         <p id="second">
655                                 <ul id="third"></ul>
656                                 <a id="fourth"></a>
657                         </p>
658                 </div>
659                 <span id="another"></span>
660         </div>
662 ### See Also:
664 [Element:grab](#Element:grab), [Element:inject](#Element:inject), [Element:wraps](#Element:wraps)
668 Element Method: wraps {#Element:wraps}
669 --------------------------------------
671 Works like [Element:grab](#Element:grab), but replaces the element in its place, and then appends the replaced element in the location specified inside the this element.
673 ### Syntax:
675         myParent.wraps(el[, where]);
677 ### Arguments:
679 1. el - (*mixed*) The id of an element or an Element.
680 2. where - (*string*, optional: default 'bottom') The place to insert the passed in element. Can be 'top' or 'bottom'.
682 ### Returns:
684 * (*element*) This Element.
686 ### Examples:
688 ##### HTML
690         <div id="first"></div>
692 ##### JavaScript
694         var mySecondElement = new Element('div#second').wraps('first');
696 ##### Resulting HTML
698         <div id="second">
699                 <div id="first"></div>
700         </div>
702 ##### HTML
704         <div id="first"></div>
705         <div id="second">
706                 <div id="child"></div>
707         </div>
709 ##### JavaScript
711         $('second').wraps('first');
713 ##### Resulting HTML
715         <div id="second">
716                 <div id="child"></div>
717                 <div id="first"></div>
718         </div>
720 ##### JavaScript
722         $('second').wraps('first', 'top');
724 ##### Resulting HTML
726         <div id="second">
727                 <div id="first"></div>
728                 <div id="child"></div>
729         </div>
731 Element Method: appendHTML {#Element:appendHTML}
732 ------------------------------------------------
734 Works like [Element:grab](#Element:grab), but instead of accepting an id or an element, it only accepts an HTML string.
735 The HTML string will be parsed to create new DOM elements, and then injected relative to the element from where the method
736 was called.
738 ### Syntax:
740         myElement.appendHTML(html[, where]);
742 ### Arguments:
744 1. html - (*string*) The HTML string to append.
745 1. where - (*string*, optional: default 'bottom') The position to inject the text to. Values accepted are 'top', 'bottom', 'before' and 'after'.
747 ### Returns:
749 * (*element*) The current Element instance.
751 ### Examples:
753 ##### HTML
755         <div id="myElement">Hey.</div>
757 ##### JavaScript
759         $('myElement').appendHTML(' <strong>Howdy.</strong>');
761 ##### Resulting HTML
763         <div id="myElement">Hey. <strong>Howdy.</strong></div>
765 ### Notes:
767 - This method does *not* use the `innerHTML` property of an element but instead creates elements
768 directly before injecting them. Thus, it is safe to use in cases where you don't want to destroy
769 any descendant elements already present in the parent.
770 - This method uses `insertAdjacentHTML` when available.
772 ### See Also:
774 - [MDN Element:insertAdjacentHTML][].
777 Element Method: appendText {#Element:appendText}
778 ------------------------------------------------
780 Works like [Element:grab](#Element:grab), but instead of accepting an id or an element, it only accepts text.
781 A text node will be created inside this Element, in either the top or bottom position.
783 ### Syntax:
785         myElement.appendText(text[, where]);
787 ### Arguments:
789 1. text  - (*string*) The text to append.
790 1. where - (*string*, optional: default 'bottom') The position to inject the text to. Values accepted are 'top', 'bottom', 'before' and 'after'.
792 ### Returns:
794 * (*element*) The current Element instance.
796 ### Examples:
798 ##### HTML
800         <div id="myElement">Hey.</div>
802 ##### JavaScript
804         $('myElement').appendText(' Howdy.');
806 ##### Resulting HTML
808         <div id="myElement">Hey. Howdy.</div>
812 Element Method: dispose {#Element:dispose}
813 ------------------------------------------
815 Removes the Element from the DOM.
818 ### Syntax:
820         var removedElement = myElement.dispose();
822 ### Returns:
824 * (*element*) This Element. Useful to always grab the return from this function, as the element could be [injected](#Element:inject) back.
826 ### Examples:
828 ##### HTML
830         <div id="myElement"></div>
831         <div id="mySecondElement"></div>
833 ##### JavaScript
835         $('myElement').dispose();
837 ##### Resulting HTML
839         <div id="mySecondElement"></div>
841 ### See Also:
843 - [MDN Element:removeChild][]
847 Element Method: clone {#Element:clone}
848 --------------------------------------
850 Clones the Element and returns the cloned one.
853 ### Syntax:
855         var copy = myElement.clone([contents, keepid]);
857 ### Arguments:
859 1. contents - (*boolean*, optional: defaults to true) When set to false the Element's contents are not cloned.
860 2. keepid - (*boolean*, optional: defaults to false) When true the cloned Element keeps the id attribute, if present. Same goes for any of the cloned childNodes.
863 ### Returns:
865 * (*element*) The cloned Element.
867 ### Examples:
869 ##### HTML
871         <div id="myElement">ciao</div>
873 ##### JavaScript
875         // clones the Element and appends the clone after the Element.
876         var clone = $('myElement').clone().inject('myElement','after');
878 ##### Resulting HTML
880         <div id="myElement">ciao</div>
881         <div>ciao</div>
883 ### Note:
885 - The returned Element does not have attached events. To clone the events use [Element:cloneEvents](/Element/Element.Event#Element:cloneEvents).
886 - Values stored in Element.Storage are not cloned.
887 - The clone element and its children are stripped of ids, unless otherwise specified by the keepid parameter.
889 ### See Also:
891 - [Element:cloneEvents](/Element/Element.Event#Element:cloneEvents).
895 Element Method: replaces {#Element:replaces}
896 --------------------------------------------------
898 Replaces the passed Element with Element.
900 ### Syntax:
902         var element = myElement.replaces(el);
904 ### Arguments:
906 1. el - (*mixed*) A string id representing the Element to be replaced, or an Element reference.
908 ### Returns:
910 * (*element*) This Element.
912 ### Examples:
914         $('myNewElement').replaces($('myOldElement'));
915         //$('myOldElement') is gone, and $('myNewElement') is in its place.
917 ### See Also:
919 - [MDN Element:replaceChild][]
923 Element Method: hasClass {#Element:hasClass}
924 --------------------------------------------
926 Tests the Element to see if it has the passed in className.
928 ### Syntax:
930         var result = myElement.hasClass(className);
932 ### Arguments:
934 1. className - (*string*) The class name to test.
936 ### Returns:
938 * (*boolean*) Returns true if the Element has the class, otherwise false.
940 ### Examples:
942 ##### HTML
944         <div id="myElement" class="testClass"></div>
946 ##### JavaScript
948         $('myElement').hasClass('testClass'); // returns true
952 Element Method: addClass {#Element:addClass}
953 --------------------------------------------
955 Adds the passed in class to the Element, if the Element doesnt already have it.
957 ### Syntax:
959         myElement.addClass(className);
961 ### Arguments:
963 1. className - (*string*) The class name to add.
965 ### Returns:
967 * (*element*) This Element.
969 ### Examples:
971 ##### HTML
973         <div id="myElement" class="testClass"></div>
975 ##### JavaScript
977         $('myElement').addClass('newClass');
979 ##### Resulting HTML
981         <div id="myElement" class="testClass newClass"></div>
985 Element Method: removeClass {#Element:removeClass}
986 ----------------------------
988 Works like [Element:addClass](#Element:addClass), but removes the class from the Element.
991 ### Syntax:
993         myElement.removeClass(className);
995 ### Arguments:
997 1. className - (*string*) The class name to remove.
999 ### Returns:
1001 * (*element*) This Element.
1003 ### Examples:
1005 ##### HTML
1007         <div id="myElement" class="testClass newClass"></div>
1009 ##### JavaScript
1011         $('myElement').removeClass('newClass');
1013 ##### Resulting HTML
1015         <div id="myElement" class="testClass"></div>
1019 Element Method: toggleClass {#Element:toggleClass}
1020 --------------------------------------------------
1022 Adds or removes the passed in class name to the Element, depending on whether or not it's already present.
1024 ### Syntax:
1026         myElement.toggleClass(className, force);
1028 ### Arguments:
1030 1. className - (*string*) The class to add or remove.
1031 2. force - (*boolean*, optional) Force the class to be either added or removed
1033 ### Returns:
1035 * (*element*) This Element.
1037 ### Examples:
1039 ##### HTML
1041         <div id="myElement" class="myClass"></div>
1043 ##### JavaScript
1045         $('myElement').toggleClass('myClass');
1047 ##### Resulting HTML
1049         <div id="myElement" class=""></div>
1051 ##### JavaScript
1053         $('myElement').toggleClass('myClass');
1055 ##### Resulting HTML
1057         <div id="myElement" class="myClass"></div>
1061 Element Method: getPrevious {#Element:getPrevious}
1062 --------------------------------------------------
1064 Returns the previousSibling of the Element (excluding text nodes).
1066 ### Syntax:
1068         var previousSibling = myElement.getPrevious([match]);
1070 ### Arguments:
1072 1. match - (*string*, optional): A tag name to match the the found element(s) with. A full CSS selector can be passed.
1074 ### Returns:
1076 * (*mixed*) The previous sibling Element or null if none found.
1080 Element Method: getAllPrevious {#Element:getAllPrevious}
1081 --------------------------------------------------------
1083 Like [Element:getPrevious][], but returns a collection of all the matched previousSiblings.
1087 Element Method: getNext {#Element:getNext}
1088 ------------------------------------------
1090 As [Element:getPrevious][], but tries to find the nextSibling (excluding text nodes).
1093 ### Syntax:
1095         var nextSibling = myElement.getNext([match]);
1097 ### Arguments:
1099 1. match - (*string*, optional): A comma seperated list of tag names to match the found element(s) with. A full CSS selector can be passed.
1101 ### Returns:
1103 * (*mixed*) The next sibling Element or null if none found.
1106 Element Method: getAllNext {#Element:getAllNext}
1107 ------------------------------------------------
1109 Like Element.getNext, but returns a collection of all the matched nextSiblings.
1113 Element Method: getFirst {#Element:getFirst}
1114 --------------------------------------------
1116 Gets the first element that matches the passed in expression.
1119 ### Syntax:
1121         var firstElement = myElement.getFirst([match]);
1123 ### Arguments:
1125 1. match - (*string*, optional): A full CSS selector to match the found element(s) with.
1127 ### Returns:
1129 * (*mixed*) The first found element or null if none found.
1133 Element Method: getLast {#Element:getLast}
1134 ------------------------------------------
1136 Gets the last element that matches the passed in expression.
1138 ### Syntax:
1140         var lastElement = myElement.getLast([match]);
1142 ### Arguments:
1144 1. match - (*string*, optional): A full CSS selector to match the found element(s) with.
1146 ### Returns:
1148 * (*mixed*) The last found element, or returns null if none found.
1152 Element Method: getParent {#Element:getParent}
1153 ----------------------------------------------
1155 Works as [Element:getPrevious][], but tries to find the parentNode.
1158 ### Syntax:
1160         var parent = myElement.getParent([match]);
1162 ### Arguments:
1164 1. match - (*string*, optional): A tag name to match the found element(s) with. A full CSS selector can be passed.
1166 ### Returns:
1168 * (*mixed*) The target Element's parent or null if no matching parent is found.
1172 Element Method: getParents {#Element:getParents}
1173 ------------------------------------------------
1175 Like [Element:getParent](#Element:getParent), but returns a collection of all the matched parentNodes up the tree.
1177 ### Returns:
1179 * (*array*) If no matching parents are found, an empty array is returned.
1183 Element Method: getSiblings {#Element:getSiblings}
1184 --------------------------------------------------
1186 Like [Element:getAllPrevious][] but returns all Element's previous and next siblings (excluding text nodes). Returns as [Elements][].
1189 ### Syntax:
1191         var siblings = myElement.getSiblings([match]);
1193 ### Arguments:
1195 1. match - (*string*, optional): A tag name to match the found element(s) with. A full CSS selector can be passed.
1197 ### Returns:
1199 * (*array*) A [Elements](#Elements) array with all of the Element's siblings, except the text nodes.
1203 Element Method: getChildren {#Element:getChildren}
1204 --------------------------------------------------
1206 Returns all the Element's children (excluding text nodes). Returns as [Elements][].
1209 ### Syntax:
1211         var children = myElement.getChildren([match]);
1213 ### Arguments:
1215 1. match - (*string*, optional): A tag name to match the found element(s) with. A full CSS selector can be passed.
1217 ### Returns:
1219 * (*array*) A [Elements](#Elements) array with all of the Element's children, except the text nodes.
1221 ### Note:
1223 The difference between the methods *getChildren* and *getElements* is that getChildren will only return its direct children while getElements searches for all the Elements in any depth.
1225 Element Method: empty {#Element:empty}
1226 --------------------------------------
1228 Empties an Element of all its children.
1231 ### Syntax:
1233         myElement.empty();
1235 ### Returns:
1237 * (*element*) This Element.
1239 ### Examples:
1241 ##### HTML
1243         <div id="myElement">
1244                 <p></p>
1245                 <span></span>
1246         </div>
1248 ##### JavaScript
1250         $('myElement').empty();
1252 ##### Resulting HTML
1254         <div id="myElement"></div>
1255         
1256 ### Note:
1258 This method does not garbage college the children. Use [Element:destroy][] instead.
1262 Element Method: destroy {#Element:destroy}
1263 ------------------------------------------
1265 Removes the Element and its children from the DOM and prepares them for garbage collection.
1267 ### Syntax:
1269         myElement.destroy();
1271 ### Returns:
1273 * (*null*)
1277 Element Method: toQueryString {#Element:toQueryString}
1278 ------------------------------------------------------
1280 Reads the child inputs of the Element and generates a query string based on their values.
1283 ### Syntax:
1285         var query = myElement.toQueryString();
1287 ### Returns:
1289 * (*string*) A string representation of a all the input Elements' names and values.
1291 ### Examples:
1293 ##### HTML
1295         <form id="myForm" action="submit.php">
1296                 <input name="email" value="bob@bob.com" />
1297                 <input name="zipCode" value="90210" />
1298         </form>
1300 ##### JavaScript
1302         $('myForm').toQueryString(); // returns "email=bob@bob.com&zipCode=90210".
1305 Element Method: getSelected {#Element:getSelected}
1306 --------------------------------------------------
1308 Returns the selected options of a select element.
1311 ### Syntax:
1313         var selected = mySelect.getSelected();
1315 ### Returns:
1317 * (*array*) An array of the selected elements.
1319 ### Examples:
1321 ##### HTML
1323         <select id="country-select" name="country">
1324                 <option value="US">United States</option
1325                 <option value ="IT">Italy</option>
1326         </select>
1328 ##### JavaScript
1330         $('country-select').getSelected(); // returns whatever the user selected.
1332 ### Note:
1334 This method returns an array, regardless of the multiple attribute of the select element.
1335 If the select is single, it will return an array with only one item.
1339 Element Method: getProperty {#Element:getProperty}
1340 --------------------------------------------------
1342 Returns a single element attribute.
1344 ### Syntax:
1346         var myProp = myElement.getProperty(property);
1348 ### Arguments:
1350 * property - (*string*) The property to be retrieved.
1352 ### Returns:
1354 * (*string*) A string containing the Element's requested property.
1356 ### Examples:
1358 ##### HTML
1360         <img id="myImage" src="mootools.png" title="MooTools, the compact JavaScript framework" alt="" />
1362 ##### JavaScript
1364         var imgProps = $('myImage').getProperty('src'); // returns: 'mootools.png'.
1368 Element Method: getProperties {#Element:getProperties}
1369 ------------------------------------------------------
1371 Gets multiple element attributes.
1373 ### Syntax:
1375         var myProps = myElement.getProperties(properties);
1377 ### Arguments:
1379 * properties - (*strings*) Any number of properties to be retrieved.
1381 ### Returns:
1383 * (*object*) An object containing all of the Element's requested properties.
1385 ### Examples:
1387 ##### HTML
1389         <img id="myImage" src="mootools.png" title="MooTools, the compact JavaScript framework" alt="" />
1391 ##### JavaScript
1393         var imgProps = $('myImage').getProperties('id', 'src', 'title', 'alt');
1394         // returns: { id: 'myImage', src: 'mootools.png', title: 'MooTools, the compact JavaScript framework', alt: '' }
1398 Element Method: setProperty {#Element:setProperty}
1399 --------------------------------------------------
1401 Sets an attribute or special property for this Element.
1404 ### Arguments:
1406 1. property - (*string*) The property to assign the value passed in.
1407 2. value - (*mixed*) The value to assign to the property passed in.
1409 ### Returns:
1411 * (*element*) - This Element.
1413 ### Examples:
1415 ##### HTML
1417         <img id="myImage" />
1419 ##### JavaScript
1421         $('myImage').setProperty('src', 'mootools.png');
1423 ##### Resulting HTML
1425         <img id="myImage" src="mootools.png" />
1427 ### Note
1429 - Whenever using [Element:setProperty][] to set an attribute, pass in the lowercase, simplified form of the property. For example:
1430         - use 'for', not 'htmlFor',
1431         - use 'class', not 'className'
1432         - use 'frameborder', not 'frameBorder'
1433         - etc.
1434 - When setting the `src` property for an image file, be sure to remove the `width` and `height` attribute (use `Element.removeAttribute`). IE7, and less, set and freeze the `width` and `height` of an image if previously specified.
1436 Element Method: setProperties {#Element:setProperties}
1437 ------------------------------------------------------
1439 Sets numerous attributes for the Element.
1442 ### Arguments:
1444 1. properties - (*object*) An object with key/value pairs.
1446 ### Returns:
1448 * (*element*) This Element.
1450 ### Examples:
1452 ##### HTML
1454         <img id="myImage" />
1456 ##### JavaScript
1458         $('myImage').setProperties({
1459                 src: 'whatever.gif',
1460                 alt: 'whatever dude'
1461         });
1463 ##### Resulting HTML
1465         <img id="myImage" src="whatever.gif" alt="whatever dude" />
1469 Element Method: removeProperty {#Element:removeProperty}
1470 --------------------------------------------------------
1472 Removes an attribute from the Element.
1475 ### Syntax:
1477         myElement.removeProperty(property);
1479 ### Arguments:
1481 1. property - (*string*) The attribute to remove.
1483 ### Returns:
1485 * (*element*) This Element.
1487 ### Examples:
1489 ##### HTML
1491         <a id="myAnchor" href="#" onmousedown="alert('click');"></a>
1493 ##### JavaScript
1495         //Eww... inline JavaScript is bad! Let's get rid of it.
1496         $('myAnchor').removeProperty('onmousedown');
1498 ##### Resulting HTML
1500         <a id="myAnchor" href="#"></a>
1504 Element Method: removeProperties {#Element:removeProperties}
1505 ------------------------------------------------------------
1507 Removes numerous attributes from the Element.
1510 ### Syntax:
1512         myElement.removeProperties(properties);
1514 ### Arguments:
1516 1. properties - (*strings*) The attributes to remove, separated by comma.
1518 ### Returns:
1520 * (*element*) This Element.
1522 ### Examples:
1524 ##### HTML
1526         <a id="myAnchor" href="#" title="hello world"></a>
1528 ##### JavaScript
1530         $('myAnchor').removeProperties('id', 'href', 'title');
1532 ##### Resulting HTML
1534         <a></a>
1537 Element Method: store {#Element:store}
1538 --------------------------------------
1540 Stores an item in the Elements Storage, linked to this Element.
1543 ### Syntax:
1545         myElement.store(key, value);
1547 ### Arguments:
1549 1. key - (*string*) The key you want to assign to the stored value.
1550 2. value - (*mixed*) Any value you want to store.
1552 ### Returns:
1554 * (*element*) This Element.
1556 ### Example:
1558         $('element').store('someProperty', someValue);
1561 Element Method: retrieve {#Element:retrieve}
1562 --------------------------------------------
1564 Retrieves a value from the Elements storage.
1567 ### Syntax:
1569         myElement.retrieve(key[, default]);
1571 ### Arguments:
1573 1. key - (*string*) The key you want to retrieve from the storage.
1574 2. default - (*mixed*, optional) Default value to store and return if no value is stored.
1576 ### Returns:
1578 * (*mixed*) The value linked to the key.
1580 ### Example:
1582         $('element').retrieve('someProperty'); // returns someValue (see example above)
1585 Element Method: eliminate {#Element:eliminate}
1586 --------------------------------------------
1588 Eliminates a key from the Elements storage.
1591 ### Syntax:
1593         myElement.eliminate(key);
1595 ### Arguments:
1597 1. key - (*string*) The key you want to eliminate from the storage.
1599 ### Returns:
1601 * (*mixed*) The element/window/document.
1603 ### Example:
1605         $('element').eliminate('someProperty');
1611 Object: Element.Properties {#Element-Properties}
1612 ==============================================
1614 This Object contains the functions that respond to the first argument passed in [Element:get][], [Element:set][] and [Element:erase][].
1616 ### Adding a Custom Element Property
1618         Element.Properties.disabled = {
1620                 get: function(){
1621                         return this.disabled;
1622                 },
1624                 set: function(value){
1625                         this.disabled = !!value;
1626                         this.setAttribute('disabled', !!value);
1627                 }
1629         };
1631 ### Using a Custom Element Property
1633         // gets the "disabled" property
1634         $(element).get('disabled');
1635         // sets the "disabled" property to true, along with the attribute
1636         $(element).set('disabled', true);
1639 ### Using an Object:
1641 Additionally, you can access these custom getters and setters using an object as the parameter for the [set](#Element:set) method.
1643 #### Example:
1645         // using set:
1646         $(divElement).set({html: '<p>Hello <em>People</em>!</p>', style: 'background:red'});
1648         // for new Elements (works the same as set):
1649         new Element('input', {type: 'checkbox', checked: true, disabled: true});
1652 ### Notes:
1654 - Automatically returns the element for setters.
1655 - Since MooTools 1.3 this is a native JavaScript Object and not an instance of the deprecated Hash
1659 Element Property: html {#Element-Properties:html}
1660 -------------------------------------------------
1662 ### Setter:
1664 Sets the innerHTML of the Element.
1666 #### Syntax:
1668         myElement.set('html', html);
1670 #### Arguments:
1672 1. html - (*string*) The new content as HTML string.
1674 #### Returns:
1676 * (*element*) This Element.
1678 #### Examples:
1680 ##### HTML
1682         <div id="myElement"></div>
1684 ##### JavaScript
1686         $('myElement').set('html', '<div></div><p></p>');
1688 ##### Resulting HTML
1690         <div id="myElement">
1691                 <div></div>
1692                 <p></p>
1693         </div>
1695 ### Getter:
1697 Returns the inner HTML of the Element.
1699 #### Syntax:
1701         myElement.get('html');
1703 #### Returns:
1705 * (*text*) This Element's innerHTML.
1709 Element Property: text {#Element-Properties:text}
1710 -------------------------------------------------
1712 ### Setter:
1714 Sets the inner text of the Element.
1716 #### Syntax:
1718         myElement.set('text', text);
1720 #### Arguments:
1722 1. text - (*string*) The new text content for the Element.
1724 #### Returns:
1726 * (*element*) This Element.
1728 #### Examples:
1730 ##### HTML
1732         <div id="myElement"></div>
1734 ##### JavaScript
1736         $('myElement').set('text', 'some text');
1737         // the text of myElement is now 'some text'.
1739 ##### Resulting HTML
1741         <div id="myElement">some text</div>
1743 ### Getter:
1745 Gets the inner text of the Element.
1747 #### Syntax:
1749         var myText = myElement.get('text');
1751 #### Returns:
1753 * (*string*) The text of the Element.
1755 #### Examples:
1757 ##### HTML
1759         <div id="myElement">my text</div>
1761 ##### JavaScript
1763         var myText = $('myElement').get('text'); // myText = 'my text'.
1767 Element Property: tag {#Element-Properties:tag}
1768 -----------------------------------------------
1770 ### Getter:
1772 Returns the tag name of the Element in lower case.
1774 #### Syntax:
1776         var myTag = myElement.get('tag');
1778 #### Returns:
1780 * (*string*) The tag name in lower case.
1782 #### Examples:
1784 ##### HTML
1786         <img id="myImage" />
1788 ##### JavaScript
1790         var myTag = $('myImage').get('tag'); // myTag = 'img'
1794 Type: IFrame {#IFrame}
1795 ========================
1797 Custom Type to create and easily work with IFrames.
1801 IFrame Method: constructor {#IFrame:constructor}
1802 ------------------------------------------------
1804 Creates an IFrame HTML Element and extends its window and document with MooTools.
1807 ### Syntax:
1809         var myIFrame = new IFrame([el][, props]);
1811 ### Arguments:
1813 1. el - (*mixed*, optional) The id of the IFrame to be converted, or the actual IFrame element. If its not passed, a new IFrame will be created (default).
1814 2. props - (*object*, optional) The properties to be applied to the new IFrame. Same as [Element:constructor](#Element:constructor) props argument.
1816 ### Returns:
1818 * (*element*) A new IFrame HTML Element.
1820 ### Examples:
1822         var myIFrame = new IFrame({
1824                 src: 'http://mootools.net/',
1826                 styles: {
1827                         width: 800,
1828                         height: 600,
1829                         border: '1px solid #ccc'
1830                 },
1832                 events: {
1834                         mouseenter: function(){
1835                                 alert('Welcome aboard.');
1836                         },
1838                         mouseleave: function(){
1839                                 alert('Goodbye!');
1840                         },
1842                         load: function(){
1843                                 alert('The iframe has finished loading.');
1844                         }
1846                 }
1848         });
1851 ### Notes:
1853 - If the IFrame already exists and has a different name than id, the name will be made the same as the id.
1854 - An IFrame's window and document will not be extended with MooTools methods.
1858 Type: Elements {#Elements}
1859 ============================
1861 The Elements class allows [Element][] methods to work on an [Elements][] array, as well as [Array][] Methods.
1865 Elements Method: constructor {#Elements:constructor}
1866 ----------------------------------------------------
1869 ### Syntax:
1871         var myElements = new Elements(elements[, options]);
1873 ### Arguments:
1875 1. elements - (*mixed*) An array of elements or an HTMLCollection Object.
1877 ### Returns:
1879 * (*array*) An array-like Elements collection with the [Element][], [Elements][] and [Array][] methods.
1881 ### Examples:
1883 #### Set Every Paragraph's Color to Red:
1885         $$('p').each(function(el){
1886                 el.setStyle('color', 'red');
1887         });
1889         // Because $$('myselector') also accepts Element methods, the below
1890         // example has the same effect as the one above.
1891         $$('p').setStyle('color', 'red');
1894 #### Create Elements From an Array:
1896         var myElements = new Elements(['myElementID', $('myElement'), 'myElementID2', document.getElementById('myElementID3')]);
1899 ### Notes:
1901 - In MooTools, every DOM function which returns a collection of nodes (such as [$$][]) returns the nodes as instances of Elements.
1902 - Because Elements is an array-like-object, it accepts all the [Array][] methods, while giving precedence to [Element][] and [Elements][] methods.
1903 - Every node of the Elements instance has all the [Element][] methods.
1905 ### See Also:
1907 - [$$][], [$][], [Element][], [Elements][], [Array][]
1910 Elements Method: append {#Elements:append}
1911 ------------------------------------------
1913 Adds the items of the collection to this [Elements][] array, and return the this array.
1915 ### Syntax:
1917         elements.append(collection);
1919 ### Arguments:
1921 1. collection - (*array*) [Elements][] array or an array of HTML Elements.
1923 ### Returns:
1925 * (*array*) This [Elements][] array.
1927 ### Notes:
1929 - This method doesn't process ([document:id][] or filters) the items of the array.
1932 Elements Method: concat {#Elements:concat}
1933 ------------------------------------------
1935 Adds the element, or array of Elements, to this [Elements][] array, and returns a new [Elements][] array.
1937 ### Syntax:
1939         var newElements = elements.concat(element[, list, id, ...]]);
1941 ### Arguments:
1943 1. element - (*mixed*) An HTML Element, or a string id.
1944 2. list, id, ... - (*mixed*) Additional [Elements][], array of ids, or string ids.
1946 ### Returns:
1948 * (*array*) A new [Elements][] array.
1951 Elements Method: empty {#Elements:empty}
1952 ------------------------------------------
1954 Removes every item from the [Elements][] array, and the empty array.
1956 ### Syntax:
1958         elements.empty();
1960 ### Returns:
1962 * (*array*) This empty [Elements][] array.
1964 ### Note:
1966 `Elements.empty` does not destroy the elements inside. As best practice, always destroy your elements if they're no longer in use. For example:
1968     $$('div').destroy().empty();
1970 ### See Also
1972  - [Element:destroy][]
1976 Elements Method: filter {#Elements:filter}
1977 ------------------------------------------
1979 Filters a collection of elements by a given css selector, or filtering function like [Array:filter][].
1982 ### Syntax:
1984         var filteredElements = elements.filter(selector);
1986 ### Arguments:
1988 1. selector - (*mixed*) A single CSS selector, or filtering function.
1990 ### Returns:
1992 * (*array*) A subset of this [Elements][] instance.
1995 Elements Method: push {#Elements:push}
1996 --------------------------------------
1998 Adds the element, or elements, to the end of this [Elements][] array and returns the length of the array.
2001 ### Syntax:
2003         var length = elements.push(element[, id, ...]]);
2005 ### Arguments:
2007 1. element - (*mixed*) An HTML Element, or a string id.
2008 2. id, ... - (*mixed*) Additional HTML Element, or string ids.
2010 ### Returns:
2012 * (*number*) The new length of the [Elements][] array.
2015 Elements Method: unshift {#Elements:unshift}
2016 --------------------------------------------
2018 Adds the element, or elements, to the front of this [Elements][] array and returns the length of the array.
2020 ### Syntax:
2022         var length = elements.unshift(element[, id, ...]]);
2024 ### Arguments:
2026 1. element - (*mixed*) An HTML Element, or a string id.
2027 2. id, ... - (*mixed*) Additional HTML Element, or string ids.
2029 ### Returns:
2031 * (*number*) The new length of the [Elements][] array.
2034 Deprecated Functions {#Deprecated-Functions}
2035 ============================================
2037 Element Method: hasChild {#Deprecated-Functions:hasChild}
2038 ---------------------------------------------------------
2040 This method has been deprecated. Use [Element:contains][] instead.
2042 ### Example:
2044         var myElement = document.id('element1');
2045         var myElement2 = document.id('element2');
2046         myElement !== myElement2 && myElement.contains(element2);
2048         // could be implemented as:
2049         Element.implement('hasChild', function(element){
2050                 return this !== element && this.contains(element);
2051         });
2053 Element Method: injectBefore {#Deprecated-Functions:injectBefore}
2054 -----------------------------------------------------------------
2056 This method has been deprecated. Use [Element:inject][] instead.
2058 Element Method: injectAfter {#Deprecated-Functions:injectAfter}
2059 ---------------------------------------------------------------
2061 This method has been deprecated. Use [Element:inject][] instead.
2063 Element Method: injectBottom {#Deprecated-Functions:injectBottom}
2064 -----------------------------------------------------------------
2066 This method has been deprecated. Use [Element:inject][] instead.
2068 Element Method: injectTop {#Deprecated-Functions:injectTop}
2069 -----------------------------------------------------------
2071 This method has been deprecated. Use [Element:inject][] instead.
2073 Element Method: injectInside {#Deprecated-Functions:injectInside}
2074 -----------------------------------------------------------------
2076 This method has been deprecated. Use [Element:inject][] instead.
2078 Element Method: grabBefore {#Deprecated-Functions:grabBefore}
2079 -----------------------------------------------------------------
2081 This method has been deprecated. Use [Element:grab][] instead.
2083 Element Method: grabAfter {#Deprecated-Functions:grabAfter}
2084 ---------------------------------------------------------------
2086 This method has been deprecated. Use [Element:grab][] instead.
2088 Element Method: grabBottom {#Deprecated-Functions:grabBottom}
2089 -----------------------------------------------------------------
2091 This method has been deprecated. Use [Element:grab][] instead.
2093 Element Method: grabTop {#Deprecated-Functions:grabTop}
2094 -----------------------------------------------------------
2096 This method has been deprecated. Use [Element:grab][] instead.
2098 Element Method: grabInside {#Deprecated-Functions:grabInside}
2099 -----------------------------------------------------------------
2101 This method has been deprecated. Use [Element:grab][] instead.
2104 Elements Method: extend {#Deprecated-Functions:extend}
2105 ------------------------------------------------------
2107 This method has been deprecated. Use [Elements:append][] instead.
2110 [document:id]: #Window:document-id
2111 [$]: #Window:dollar
2112 [$$]: #Window:dollars
2114 [Array]: /core/Types/Array
2115 [Array:filter]: /core/Types/Array#Array:filter
2117 [Element]: #Element
2118 [Elements]: #Elements
2119 [Elements:append]: #Elements:append
2120 [Element:inject]: #Element:inject
2121 [Element:set]: #Element:set
2122 [Element:get]: #Element:get
2123 [Element:destroy]: #Element:destroy
2124 [Element:grab]: #Element:grab
2125 [Element:erase]: #Element:erase
2126 [Element:setProperty]: #Element:setProperty
2127 [Element:getProperty]: #Element:getProperty
2128 [Element:removeProperty]: #Element:removeProperty
2129 [Element:getElement]: #Element:getElement
2130 [Element:getElements]: #Element:getElements
2131 [Element.Properties]: #Element-Properties
2132 [Element:getPrevious]: #Element:getPrevious
2133 [Element:getAllPrevious]: #Element:getAllPrevious
2134 [Element:contains]: #Element:contains
2136 [Element:addEvents]: /core/Element/Element.Event#Element:addEvents
2137 [Element:setStyles]: /core/Element/Element.Style#Element:setStyles
2139 [The Dollar Safe Mode]: http://mootools.net/blog/2009/06/22/the-dollar-safe-mode/
2141 [MDN Element:removeChild]: https://developer.mozilla.org/En/DOM/Node.removeChild
2142 [MDN Element:replaceChild]: https://developer.mozilla.org/En/DOM/Node.replaceChild
2143 [MDN Element:insertAdjacentHTML]: https://developer.mozilla.org/en/DOM/Element.insertAdjacentHTML