Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What html elements are tabbable

Tags:

html

tabindex

I'm trying to find a list of elements that are tabbable.

Adding tab-index to elements make them tabbable. Some elements are tabbable by default like <input>. Is there a list of these elements that are tabbable by default?

And optionally, why are they tabbable by deault?

like image 406
Persijn Avatar asked Mar 07 '16 11:03

Persijn


1 Answers

The easiest way to find answers to such questions is by looking at the spec

I believe the list you are looking for is:

  • a elements that have an href attribute
  • link elements that have an href attribute
  • button elements
  • input elements whose type attribute are not in the Hidden state
  • select elements
  • textarea elements
  • Editing hosts
  • Browsing context containers

To answer your optional question: they are "tabbable" by default for usability issues. If you follow the principals of making a good, user friendly app, it should allow for a consistent navigation and discoverability among other things.

So, by making them "tabbable", in the order they appear in code, the default behavior is to allow the user to complete a form from top to bottom, with minimal clicks and moving around, this making the "thinking process" about what should be filled next unnecessary

like image 52
Dany Khalife Avatar answered Sep 29 '22 02:09

Dany Khalife