src code

class method Element.firstDescendant

Element.firstDescendant(element) → Element

Returns the first child that is an element.

This is opposed to the firstChild DOM property, which will return any node, including text nodes.

This method can be called either as an instance method or as a generic method. If calling as a generic, pass the instance in as the first argument.