focus
Description
The focus of HTMLOrSVGElement for JS moves the focus to the element.
If the element is a navigable container, moves the focus to its content navigable instead.
By default, this method also scrolls the element into view. Providing the preventScroll option and setting it to true prevents this behavior.
Syntax
element.focus([options]) element.focus([ { preventScroll: true } ])
Parameters
options
Allows setting preventScroll.
preventScroll
Prevents scrolling the element into view.