Skip to content

Latest commit

 

History

History
63 lines (33 loc) · 1.52 KB

parents.md

File metadata and controls

63 lines (33 loc) · 1.52 KB
layout tags
doc-api.html
internal, argument-list

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.

Examples

Changes

  • Since v1.1.0 parents can be resolved for SVGElements in Internet Explorer.

Notes

Related resources

Contributing