HTML DOM tabIndexプロパティ
定義と使い方
tabIndex プロパティは、ラジオボタンのタブキーによる操作順序を設定または返します。
構文
HTMLElementObject.tabIndex=tabIndex
ブラウザサポート
![]()
![]()
![]()
![]()
![]()
すべての主要ブラウザが tabIndex プロパティをサポートしています。
例
例
3つのリンクのタブ順序を変更する:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>サンプル(example.com)</title>
<script>
function changeTabIndex()
{
document.getElementById('1').tabIndex="3"
document.getElementById('2').tabIndex="2"
document.getElementById('3').tabIndex="1"
}
</script>
</head>
<body>
<p><a id="1" href="https://www.example.com">1</a></p>
<p><a id="2" href="https://www.example.com">2</a></p>
<p><a id="3" href="https://www.example.com">3</a></p>
<input type="button" onclick="changeTabIndex()"
value="Change TabIndex">
</body>
</html>
試してみる »
その他の拡張
要素オブジェクト