Skip to content

ally.js

JavaScript library to help modern web applications with accessibility concerns by making accessibility simpler

🔗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

NameTypeDefaultDescription
context<selector>requiredThe 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.

🔗Related resources

🔗Contributing