This documentation refers to the current trunk of the Infusion code and is being updated to reflect ongoing changes. As a result, it may contain information that is not relevant to the latest release, 1.4. For documentation related to v1.4 and earlier, please see the Infusion v1.4 Documentation
Skip to end of metadata
Go to start of metadata

fluid.findAncestor(element, test)

Finds the nearest ancestor of the element that passes the test.

File name: Fluid.js

Parameters

element (Element) DOM element
test (Function) A function which takes an element as a parameter and returns true or false for some test.

Return Value

Element the nearest ancestor that passes the test

See Also


Example

In this example, fluid.findAncestor() is used to find an ancestor of smallHeader that has a desired selector.

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.