X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM tabIndex Property

HTMLElement Object Reference Element Object

Definition and Usage

The tabIndex property sets or returns the tab order for an element.

Syntax

HTMLElementObject.tabIndex=tabIndex


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The tabIndex property is supported in all major browsers.


Example

Example

Change the tab order for three links:

<html>
<head>
<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="http://www.w3schools.com">1</a></p>
<p><a id="2" href="http://www.w3schools.com">2</a></p>
<p><a id="3" href="http://www.w3schools.com">3</a></p>

<input type="button" onclick="changeTabIndex()"
value="Change TabIndex">

</body>
</html>

Try it yourself »


HTMLElement Object Reference Element Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook