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.

tabIndexHTMLElement インターフェイスのプロパティで、現在の要素のタブの順序を表します。

タブの順序は次のとおりです。

  1. 正の tabIndex を持つ要素。 同一の tabIndex を持つ要素は、表示された順序でナビゲートすべきです。 ナビゲーションは、最も低い tabIndex から最も高い tabIndex に進みます。
  2. tabIndex 属性に対応していない要素、または tabIndex 属性に対応しており、 tabIndex0 に割り当てる要素は、それらが表示された順序で。

無効になっている要素は、タブの順序に関与しません。

値は逐次的である必要はなく、特定の値で始まる必要もありません。 各ブラウザーは非常に大きな値を切り取りますが、値は負の値にすることもできます。

構文

整数です。

js
const b1 = document.getElementById("button1");

b1.tabIndex = 1;

仕様書

Specification
HTML
# dom-tabindex

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
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.

関連情報