HTML DOM tabIndex 屬性
定義和用法
tabIndex 屬性設(shè)置或返回文本域的 tab 鍵控制次序。
語法
textObject.tabIndex=number
實(shí)例
下面的例子顯示出不同文本域的 tab 鍵控制次序:
<html>
<head>
<script type="text/javascript">
function checkTab(x)
{
alert(x.tabIndex
)
}
</script>
</head>
<body>
<form id="myForm">
<input type="text" tabindex="1" onclick="checkTab(this)">
<input type="text" tabindex="2" onclick="checkTab(this)">
<input type="text" tabindex="3" onclick="checkTab(this)">
</form>
</body>
</html>