案例:javascript案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/javascript">
4
function showTabIndex()
5
{
6
var b1=document.getElementById('b1').tabIndex;
7
var b2=document.getElementById('b2').tabIndex;
8
var b3=document.getElementById('b3').tabIndex;
9
10
document.write("Tab index of Button 1: " + b1);
11
document.write("<br />");
12
document.write("Tab index of Button 2: " + b2);
13
document.write("<br />");
14
document.write("Tab index of Button 3: " + b3);
15
}
16
</script>
17
</head>
18
<body>
19
20
<button id="b1" tabIndex="1">Button 1</button><br />
21
<button id="b2" tabIndex="2">Button 2</button><br />
22
<button id="b3" tabIndex="3">Button 3</button><br />
23
<br />
24
<input type="button" onclick="showTabIndex()" value="Show tabIndex" />
25
26
</body>
27
</html>
28