|
|
|
|
|
by pverheggen
231 days ago
|
|
> Yes, but often you have elements with taborder > 0. You can just as easily apply the same tabindex to a div though. > Only if document order is sane. Usually with modern websites it isn't... Well that's the real problem, all your non-interactive content (like text) is going to be out of order too. You're just adding to the confusion if buttons and other inputs are in a different order from the content they're associated with. > Otherwise, he will pointlessly tab through search, menus, cookie bars and a ton of other pointless stuff first. The proper way of dealing with this is a "Skip to Main Content" element: https://webaim.org/techniques/skipnav/ |
|
No, it isn't the proper way. That only works if you can see the skip link and know to press enter. Otherwise you will tab straight into the navigation. So possibly useful for screen readers, but completely useless for most keyboard users. Yet another stupid webdev workaround for a selfimposed problem.
What you should do is autofocus the first form element (if there is a form), give it tabindex=1 and number the other form elements in a sensible ascending tabindex order. Otherwise, proper semantic markup is sufficient, even for screen readers.