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