HTML DOM tabIndex Property
Complete Select Object Reference
Definition and Usage
The tabIndex property sets or returns the tab order for a dropdown list.
The tab order is the order the dropdown list appear if you navigate the page
using the "tab" button on the keyboard.
Syntax
selectObject.tabIndex=number
|
Example
The following example displays the tab index of a text field and a dropdown
list:
<html>
<head>
<script type="text/javascript">
function showTabIndex()
{
var email=document.getElementById('email').tabIndex;
var sex=document.getElementById('sex').tabIndex;
document.write("Tab index of email field: " + email);
document.write("<br />");
document.write("Tab index of dropdown list: " + sex);
}
</script>
</head>
<body>
<form>
Email: <input type="text" id="email" tabindex="1" />
<br />
Sex:
<select id="sex" tabindex="2">
<option>Male</option>
<option>Female</option>
</select>
<br /><br />
<input type="button" onclick="showTabIndex()"
value="Show tabIndex" />
</form>
</body>
</html>
|
Try-It-Yourself Demos
Show
the tab index of form fields
Complete Select Object Reference
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|