Element
Document Object Model extensions.
Credits
Partially based on MooTools, My Object Oriented Javascript Tools. Copyright © 2006-2007 Valerio Proietti, http://mad4milk.net, MIT Style License. Partially based on Prototype JavaScript framework, version 1.6.0 © 2005-2007 Sam Stephenson. Prototype is freely distributable under the terms of an MIT-style license. For details, see the Prototype web site: http://www.prototypejs.org/
Summary
| Element | Document Object Model extensions. |
| Content manipulation methods | |
| addContent | |
| setText | Sets the inner text of the Element. |
| appendText | Adds a new text node at the end of the element’s existing content |
| setHTML | Sets the innerHTML of the Element. |
| Class manipulation methods | |
| hasClassName | Checks whether element has the given CSS className. |
| addClassName | Adds a CSS class to element. |
| removeClassName | Removes element’s CSS className and returns element. |
| DOM manipulation methods | |
| getParent | return a reference to the element’s parent node |
| getChildren | return a collection of the element’s child nodes |
| empty | Empty an element of all its children. |
| hide | Hides and returns element. |
| show | Displays and returns element. |
| toggle | Toggles the visibility of element. |
| remove | Completely removes element from the document and returns it. |
| getDimensions | Finds the computed width and height of element and returns them as key/value pairs of an object. |
| setStyle | Modifies element’s CSS style properties. |
| inject | Insert the Element inside the passed element |
| Events manipulation methods |
addContent: function( content )
Sets the inner text of the Element.
setText: function( text )
Adds a new text node at the end of the element’s existing content
appendText: function( text )
Sets the innerHTML of the Element.
setHTML: function( html )
Checks whether element has the given CSS className.
hasClassName: function( className )
Adds a CSS class to element.
addClassName: function( className )
Removes element’s CSS className and returns element.
removeClassName: function( className )
return a reference to the element’s parent node
getParent: function()
return a collection of the element’s child nodes
getChildren: function()
Empty an element of all its children.
empty: function()
Hides and returns element.
hide: function()
Displays and returns element.
show: function()
Toggles the visibility of element.
toggle: function()
Completely removes element from the document and returns it.
remove: function()
Finds the computed width and height of element and returns them as key/value pairs of an object.
getDimensions: function()
Modifies element’s CSS style properties.
setStyle: function( style )
Insert the Element inside the passed element
inject: function( el, where )