getParents

public function getParents(n:Node/String, f:function, r:Node):Array
Returns a node list of all parents matching the specified selector function or pattern. If the function then returns true indicating that it has found what it was looking for and that node will be collected.

Params

Name Type Description
n Node/String DOM node to search parents on or ID string.
f function Selection function to execute on each node or CSS pattern.
r Node Optional root element, never go below this point.

Returns

Array Array of nodes or null if it wasn't found.