What is the HTML tabindex attribute? (ie taborder)

About

tabindex is a global attribute that specifies whether:

  • the element represents an element that is is focusable (that is, that you can click or navigate with tab or an element which is part of the sequence of focusable elements in the document),
  • the relative order of the element in the sequence of focusable elements known as tab order in the document

Sequential keyboard navigation

Remove

You can remove an element from the tab order by setting tabindex=“-1”

Add

You can add an element to the tab order by setting tabindex=“0”:

The order is then defined by the document's source order.

1)

Get / Set via Javascript

const input = document.getElementById('input');
input.tabIndex = 1;





Discover More
Devtool Track Active Element
HTML - Focus (Active element) (and Blur)

The focus is the interactive element actually active on a HTML dom document through: a mouse click (if you mouse click on a text input field, ready to begin typing, this element will come into focus)...
HTML - Global (Element) Attribute

The global-attributesglobal attributes are common attribute to all elements in the HTML language.
HTML - Keyboard Navigation (key event)

Navigation / Manipulation of an HTML document with the keys of a keyboard. The tab key is the default key that permits to move from a interactive element to another and therefore change the focus...
Html Checkbox Illustration
How to create and use a HTML checkbox ?

This article gives you all the important information about HTML checkbox and how to use them
What is the Tab Order (Keyboard focus navigation)

The tab order is the order of interactive elements such as: links and form controls You can loop through this sequence in the browser by going to the address bar (alt+d) and pressing the tab...



Share this page:
Follow us:
Task Runner