layout | tags |
---|---|
doc-api.html |
internal, argument-list |
Identifies the element that would get focus upon click
When clicking on the <span>
element, focus is given to the <div>
, because it's the first focusable parent element.
<div tabindex="-1">
<p>Hello <span>World</span>!</p>
</div>
var element = ally.get.focusTarget({
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. |
TypeError
if context
option is not specified.