To understand the tabindex attribute, you need to know what it means for an element to gain focus; any element that a user can interact with can gain focus. If the user clicks the Tab key on his or her keyboard when a page has loaded, the browser moves focus between the parts of the page that the user can interact with. The parts of the page that can gain focus include links and some parts of forms (such as the boxes that allow you to enter text). When a link receives focus, and the user presses Enter on the keyboard, the link is activated. You can see focus working on the Google web site; if you repeatedly press the Tab key, you should see focus pass between links on the page. After it has passed across each link in turn, it goes onto the box where you enter search terms, across the site’s buttons, and usually ends up back where you typed in the URL. Then it cycles around the same elements again as you keep pressing Tab.
The tabindex attribute allows you to specify the order in which, when the Tab key is pressed, the links (or form controls) obtain focus. So, when the user clicks the Tab key, the focus may skip to the key items on the page that the user might want to interact with.
The tabindex attribute allows you to specify the order in which, when the Tab key is pressed, the links (or form controls) obtain focus. So, when the user clicks the Tab key, the focus may skip to the key items on the page that the user might want to interact with.