HTML tabindex Attribute

HTML tabindex Attribute: It defines the tab order of an element. It is used when the tab button is used for navigating. In HTML5, this attribute can be used with any HTML element but in HTML 4.01, the tabindex attribute can be used with: <a>, <area>, <button>, <input>, <object>, <select>, and <textarea>.

HTML tabindex Attribute

This attribute can be applied to all the HTML elements.

Attribute Value

This attribute contains a single value number which is used to specify the tabbing order of the element

Syntax: <element tabindex = “number”>

Browser Support

This attribute is supported by the following browsers:

  • Chrome
  • Firefox
  • Internet Explorer
  • Safari
  • Opera

Example: for tabindex attribute

<!DOCTYPE html>
<html>
<body>
<a href="https://tutorials.freshersnow.com/" tabindex="2">Freshersnow Tutorials</a><br>
<a href="https://google.com/" tabindex="2"Google</a><br>
<a href="https://microsoft.com/" tabindex="2" Microsoft</a><br>
</body>
</html>

Output:

freshersnow
Google
Microsoft

Note: Try navigating the links by using the “Tab” button on your keyboard.