class method Element.descendants

View source on GitHub →

Element.descendants(element) → [Element…]

Collects all of the element's descendants (its children, their children, etc.) and returns them as an array of extended elements. As with all of Prototype's DOM traversal methods, only Elements are returned, other nodes (text nodes, etc.) are skipped.

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.