HTML DOM tabIndex 属性

[

HTML DOM tabIndex 属性
元素对象

定义和用法

tabIndex 属性可设置或返回单选按钮的 tab 键控制次序。

语法

HTMLElementObject.tabIndex=tabIndex

浏览器支持

所有主要浏览器都支持 tabIndex 属性

实例

实例

改变三个链接的 tab 排序:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Break易站(runoob.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.runoob.com">1</a></p>
<p><a id="2" href="https://www.runoob.com">2</a></p>
<p><a id="3" href="https://www.runoob.com">3</a></p>
<input type="button" onclick="changeTabIndex()"
value="Change TabIndex">
</body>
</html>

元素对象

]
转载请保留页面地址:https://www.breakyizhan.com/html/22492.html

posted on 2020-07-05 11:54  MrAit  阅读(135)  评论(0编辑  收藏  举报

导航