案例: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
  document.write("Tab index of Button 1: " + b1);
10
  document.write("<br />");
11
  document.write("Tab index of Button 2: " + b2);
12
  document.write("<br />");
13
  document.write("Tab index of Button 3: " + b3);
14
  }
15
</script>
16
</head>
17
<body>
18
19
<form>
20
<input type="button" id="b1" tabIndex="1" value="Button 1" />
21
<br />
22
<input type="button" id="b2" tabIndex="2" value="Button 2" />
23
<br />
24
<input type="button" id="b3" tabIndex="3" value="Button 3" />
25
<br />
26
<input type="button" onclick="showTabIndex()"
27
value="Show tabIndex" />
28
</form>
29
30
</body>
31
</html>
32