HTML DOM tabIndexProperty
Definition and Usage
The tabIndex property can set or return the tab order of the radio button.
Syntax
HTMLElementObject.tabIndex=tabIndex
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the tabIndex property.
Example
Example
Change the tab order of three links:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Example Tutorial (example.com)</title>
<script>
function changeTabIndex()
{
document.getElementById('1').tabIndex="3"
document.getElementById('2').tabIndex="2"
document.getElementById('3').tabIndex="1"
}
</script>
</head>
<body>
<p><a id="1" href="https://www.example.com">1</a></p>
<p><a id="2" href="https://www.example.com">2</a></p>
<p><a id="3" href="https://www.example.com">3</a></p>
<input type="button" onclick="changeTabIndex()"
value="Change TabIndex">
</body>
</html>
Try it Yourself »
Other Extensions
Element Object