layout | tags |
---|---|
doc-api.html |
internal, argument-list |
Identifies the parent elements
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, …]
var elements = ally.get.parents({
context: '#element-to-start-from',
});
Name | Type | Default | Description |
---|---|---|---|
context | <selector> |
required | The element to start searching from. The first element of a collection is used. |
Array of HTMLElement
that is sorted `[element, element.parent, …].
TypeError
if context
option is not specified.
- Since
v1.1.0
parents can be resolved forSVGElements
in Internet Explorer.
ally.get.shadowHostParents
finds theShadowHost
ancestry of an element