# ally.get.parents
Identifies the parent elements
# Description
Like jQuery.parents()
, except ally.get.parents
doesn't have a filter arguments.
The returned list is sorted as follows [element, element.parent, element.parent.parent, …]
# Usage
var elements = ally.get.parents({
context: '#element-to-start-from',
});
# Arguments
Name | Type | Default | Description |
---|---|---|---|
context | <selector> |
required | The element to start searching from. The first element of a collection is used. |
# Returns
Array of HTMLElement
that is sorted `[element, element.parent, …].
# Throws
TypeError
if context
option is not specified.
# Changes
- Since
v1.1.0
parents can be resolved forSVGElements
in Internet Explorer.
# Related resources
ally.get.shadowHostParents
finds theShadowHost
ancestry of an element