HTMLElement: tabIndex プロパティ
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since October 2018.
tabIndex
は HTMLElement
インターフェイスのプロパティで、現在の要素のタブの順序を表します。
タブの順序は次のとおりです。
- 正の
tabIndex
を持つ要素。 同一のtabIndex
を持つ要素は、表示された順序でナビゲートすべきです。 ナビゲーションは、最も低いtabIndex
から最も高いtabIndex
に進みます。 tabIndex
属性に対応していない要素、またはtabIndex
属性に対応しており、tabIndex
を0
に割り当てる要素は、それらが表示された順序で。
無効になっている要素は、タブの順序に関与しません。
値は逐次的である必要はなく、特定の値で始まる必要もありません。 各ブラウザーは非常に大きな値を切り取りますが、値は負の値にすることもできます。
構文
整数です。
例
js
const b1 = document.getElementById("button1");
b1.tabIndex = 1;
仕様書
Specification |
---|
HTML # dom-tabindex |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
tabIndex |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- Has more compatibility info.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
関連情報
- キーボードでナビゲート可能な JavaScript ウィジェットのアクセシビリティ
- HTML の
tabindex
グローバル属性