Control where `tab` or `shift+tab` goto.
npm install tab-goto[![jsdelivr][jsdelivr-badge]][jsdelivr-link]
[![npm version][fury-badge]][fury-link]
[![codecov][codecov-badge]][codecov-link]
Control where tab or shift+tab goto .
npm:
``sh`
npm install tab-goto
Yarn:
`sh`
yarn add tab-goto
You can set any CSS Selector to tab-goto or shift-tab-goto attribute to control where tab or shift+tab goto. We use querySelector() internally to find the element to focus.
CDN:
`html
ESM:
`js
import "tab-goto";
`API
$3
The
config() method is used to configure tab goto uses attribute names and enable/disable tab goto.#### Example
CDN:
`html
my-div
`ESM:
`js
import { config as configTabGoto } from "tab-goto";configTabGoto({
tabGotoName: "my-tab-goto",
shiftTabGotoName: "my-shift-tab-goto",
enableTabGoto: true,
enableShiftTabGoto: true,
});
`#### Parameters
-
options (Object) - The options object.
- tabGotoName (string) - The attribute name of tab goto. Default: tab-goto.
- shiftTabGotoName (string) - The attribute name of shift tab goto. Default: shift-tab-goto.
- enableTabGoto (boolean) - Whether enable tab goto. Default: true.
- enableShiftTabGoto (boolean) - Whether enable shift tab goto. Default: true`.[tab-goto]: https://zjffun.github.io/tab-goto/
[fury-link]: https://badge.fury.io/js/tab-goto
[fury-badge]: https://badge.fury.io/js/tab-goto.svg
[jsdelivr-link]: https://www.jsdelivr.com/package/npm/tab-goto
[jsdelivr-badge]: https://data.jsdelivr.com/v1/package/npm/tab-goto/badge
[codecov-badge]: https://codecov.io/gh/zjffun/tab-goto/branch/main/graph/badge.svg
[codecov-link]: https://codecov.io/gh/zjffun/tab-goto