class Element
Description
The Element
object provides a variety of powerful DOM methods for
interacting with DOM elements — creating them, updating them,
traversing them, etc. You can access these either as methods of Element
itself, passing in the element to work with as the first argument, or as
methods on extended element instances:
// Using Element:
Element.addClassName('target', 'highlighted');
// Using an extended element instance:
$('target').addClassName('highlighted');
Element
is also a constructor for building element instances from scratch,
see new Element
for details.
Most Element
methods return the element instance, so that you can chain
them easily:
$('message').addClassName('read').update('I read this message!');
More Information
For more information about extended elements, check out "How Prototype extends the DOM", which will walk you through the inner workings of Prototype's DOM extension mechanism.
Classes
-
Element.Layout
A set of key/value pairs representing measurements of various dimensions of an element.
-
Element.Offset
A representation of the top- and left-offsets of an element relative to another.
Constructor
Class methods
absolutize
absolutize
addClassName
addMethods
adjacent
ancestors
childElements
classNames
cleanWhitespace
clone
clonePosition
cumulativeOffset
cumulativeOffset
cumulativeScrollOffset
cumulativeScrollOffset
descendantOf
descendants
down
empty
extend
fire
firstDescendant
getDimensions
getElementsBySelector
getHeight
getLayout
getOffsetParent
getOffsetParent
getOpacity
getStorage
getStyle
getWidth
hasAttribute
hasClassName
hide
identify
immediateDescendants
insert
inspect
makeClipping
makePositioned
match
measure
next
nextSiblings
observe
on
positionedOffset
positionedOffset
previous
previousSiblings
purge
readAttribute
recursivelyCollect
relativize
relativize
remove
removeClassName
replace
retrieve
scrollTo
select
setOpacity
setStyle
show
siblings
stopObserving
store
toggle
toggleClassName
undoClipping
undoPositioned
up
update
viewportOffset
viewportOffset
visible
wrap
writeAttribute
Instance methods
absolutize
absolutize
addClassName
adjacent
ancestors
childElements
classNames
cleanWhitespace
clone
clonePosition
cumulativeOffset
cumulativeOffset
cumulativeScrollOffset
cumulativeScrollOffset
descendantOf
descendants
down
empty
fire
firstDescendant
getDimensions
getElementsBySelector
getHeight
getLayout
getOffsetParent
getOffsetParent
getOpacity
getStorage
getStyle
getWidth
hasAttribute
hasClassName
hide
identify
immediateDescendants
insert
inspect
makeClipping
makePositioned
match
measure
next
nextSiblings
observe
on
positionedOffset
positionedOffset
previous
previousSiblings
purge
readAttribute
recursivelyCollect
relativize
relativize
remove
removeClassName
replace
retrieve
scrollTo
select
setOpacity
setStyle
show
siblings
stopObserving
store
toggle
toggleClassName
undoClipping
undoPositioned
up
update
viewportOffset
viewportOffset
visible
wrap
writeAttribute