HTML DOM tabIndex 屬性
定義和用法
tabIndex 屬性可設(shè)置或返回 checkbox 的 tab 鍵控制次序。
語法
checkboxObject.tabIndex=number
實(shí)例
下面的例子可更改 checkbox 的 tab index:
<html>
<head>
<script type="text/javascript">
function changeTabIndex()
{
document.getElementById('check3').tabIndex="1"
document.getElementById('check1').tabIndex="3"
}
</script>
</head>
<body>
<form>
<input type="checkbox" id="check1" tabIndex="1" /><br />
<input type="checkbox" id="check2" tabIndex="2" /><br />
<input type="checkbox" id="check3" tabIndex="3" /><br />
<input type="button" onclick="changeTabIndex()" value="Change tabIndex" />
</form>
</body>
</html>