Element
- absolutize
- addClassName
- addMethods
- adjacent
- ancestors
- childElements
- classNames
- cleanWhitespace
- clonePosition
- cumulativeOffset
- cumulativeScrollOffset
- descendantOf
- descendants
- down
- empty
- extend
- fire
- firstDescendant
- getDimensions
- getElementsByClassName
- getElementsBySelector
- getHeight
- getOffsetParent
- getStyle
- getWidth
- hasClassName
- hide
- identify
- immediateDescendants
- insert
- inspect
- makeClipping
- makePositioned
- match
- next
- nextSiblings
- observe
- positionedOffset
- previous
- previousSiblings
- readAttribute
- recursivelyCollect
- relativize
- remove
- removeClassName
- replace
- scrollTo
- select
- setOpacity
- setStyle
- show
- siblings
- stopObserving
- toggle
- toggleClassName
- undoClipping
- undoPositioned
- up
- update
- viewportOffset
- visible
- wrap
- writeAttribute
firstDescendant
1.5.1
firstDescendant(element) -> HTMLElement
Returns the first child that is an element. This is opposed to firstChild
DOM property which will return any node (whitespace in most usual cases).
Examples
<div id="australopithecus">
<div id="homo-erectus"><!-- Latin is super -->
<div id="homo-neanderthalensis"></div>
<div id="homo-sapiens"></div>
</div>
</div>
$('australopithecus').firstDescendant();
// -> div#homo-herectus
// the DOM property returns any first node
$('homo-herectus').firstChild;
// -> comment node "Latin is super"
// this is what we want!
$('homo-herectus').firstDescendant();
// -> div#homo-neanderthalensis