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;