HTML DOM tabIndexプロパティ

元素对象参考手册要素オブジェクト


定義と使い方

tabIndex プロパティは、ラジオボタンのタブキーによる操作順序を設定または返します。

構文

HTMLElementObject.tabIndex=tabIndex


ブラウザサポート

Internet ExplorerFirefoxOperaGoogle ChromeSafari

すべての主要ブラウザが 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>

試してみる »


元素对象参考手册要素オブジェクト

その他の拡張