How to visualize the tab order without using an extension in Firefox
Tags: webdev, a11y
Published: 2021-07-05 10:43:45

---
title: How to visualize the tab order without using an extension in Firefox
published: true
description: Use Firefox's "Show tab order" feature to debug the focus order interactive elements.
tags: webdev, a11y
canonical_url: https://www.stefanjudis.com/today-i-learned/how-to-visualize-the-tab-order-without-using-an-extension-in-firefox/
---

[Focus order is a success criterion defined in the Web Content Accessibility Guidelines](https://www.w3.org/WAI/WCAG21/Understanding/focus-order.html) (WCAG). Website visitors have to be able to navigate content and focusable element sequentially.

> Success Criterion 2.4.3 Focus Order (Level A): If a Web page can be navigated sequentially and the navigation sequences affect meaning or operation, focusable components receive focus in an order that preserves meaning and operability.

How can you test for this accessibility success criterion most effectively? 

The first option, tab around your web pages manually and see where the focus wanders. While there's nothing wrong with this, browser dev tools (mainly Firefox) offer valuable alternatives to manual testing these days. 

Let's have a look!

## Firefox – "show tabbing order" of all focusable elements

![Firefox DevTools with an Open Accessibility panel that includes the "Show Tabbing Order" checkbox](//images.contentful.com/f20lfrunubsq/sZpqqx0CQl6OgM1KUkhon/c62211f78761be1cf25a3fe0a719c71f/Screen_Shot_2021-07-04_at_23.43.56.png)

[I rediscovered the "Show tabbing order" functionality in Firefox's accessibility dev tools last week](https://twitter.com/stefanjudis/status/1409442447218860032). **It is such a beautiful feature!** 

Instead of tabbing around to evaluate the focus order, the developer tools show you the order. Turn on the visual tabbing order, scroll through the page, and see if the focus order makes sense!

## Chrome (starting 92) – "show source order" in the DOM tree

![Chrome DevTools showing the Elements panel with open Accesibility pane that include a "Show source order" checkbox](//images.contentful.com/f20lfrunubsq/1ZP0kkvPN0EIGst4v951rM/f49e28eb7d4eb2bf2843e308006acfce/Screen_Shot_2021-07-04_at_23.49.31.png)

After sharing this Firefox functionality on Twitter, [Jecelyn Yeen replied and mentioned that Chrome will have a similar feature starting with Chrome 92](https://twitter.com/JecelynYeen/status/1409759527549890562?s=20) (I tested it in the current Chrome beta). When inspecting DOM elements, open the accessibility pane on the right side and enable "Show source order". 

And while the feature looks almost identical to Firefox's "Show tab order", they're two pretty different features...

## The difference between "Show tabbing order" (Firefox) and "Show source order" (Chromium)

As the different labels already reveal, the features look alike but have other purposes.

Firefox shows *the focus order of all interactive elements*, which is pretty much what you test when tabbing around on a web page. You can use the displayed order to debug and improve focus order.

On the other hand, Chrome shows *the source order of the currently selected DOM element's children*. This visualization is not very helpful for debugging focus accessibility, but it can help when looking at and debugging flex or grid layouts.

## How do you test that your focusable elements are accessible?

As you see, I like Firefox's implementation of this feature. I'd love to learn how you test and debug focus order? Do you tab around manually, or do you have a more sophisticated approach? 

If you do, [I'd love to hear about it](mailto:stefanjudis@gmail.com)!