Skip to content
Related Articles

Related Articles

HTML | DOM tabIndex Property

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 27 Aug, 2021

The tabIndex property is used to return the value of the tabindex attribute of an element. The tabindex attribute specifies the tab order of an element (It is used when the tab button is used for navigating.)


  • Returns the tabIndex property: 
  • Set the tabIndex property: 
HTMLElementObject.tabIndex = number

Property Values: 

  • number: Define the tabbing order of the element.

Return Values: It returns a numeric value which represents the tab order of an element. 
Note: The element will be removed from the tab order if the number is negative.


<!DOCTYPE html>
    <title>HTML DOM tabIndex Property</title>
        body {
        h1 {
        a {
    <h2>tabindex attribute</h2>
        Geeks HTML ide
        Geeks ide
    <button onclick="gfgFun()">Try it</button>
    <p id="gfg"></p>
        function gfgFun() {
            var gfgvar = document.getElementsByTagName(
                        = gfgvar;


Supported Browsers: The browser supported by HTML DOM tabIndex Property are listed below: 

  • Chrome
  • Firefox
  • Internet Explorer
  • Opera
  • Safari

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!