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