HTML DOM tabIndex 屬性
定義和用法
tabIndex 屬性可為鏈接設(shè)置或返回 tab 鍵控制次序。
語法
anchorObject.tabIndex=tabIndex
實例
下面的例子可更改三個鏈接的 tab 鍵控制次序:
<html>
<head>
<script type="text/javascript">
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="http://www.dbjr.com.cn">1</a></p>
<p><a id="2" href="http://www.dbjr.com.cn">2</a></p>
<p><a id="3" href="http://www.dbjr.com.cn">3</a></p>
<input type="button" onclick="changeTabIndex()"
value="Change TabIndex" />
</body>
</html>