WebTech1223411 logo WebTech1223411Web tech, read closely
Accessibility

How to Use the DevTools Accessibility Tree to Debug Names

A ticket landed on my desk years ago that read, in full, "Screen reader says button button on checkout." The developer who picked it up spent most of an afternoon in VoiceOver, tabbing through the page, trying to hear the exact...

A browser developer tools panel showing an accessibility tree with button and link nodes and their computed names

A ticket landed on my desk years ago that read, in full, "Screen reader says button button on checkout." The developer who picked it up spent most of an afternoon in VoiceOver, tabbing through the page, trying to hear the exact announcement the tester had heard. He fixed it by guessing. Two sprints later the same bug came back on a different page, because nobody had seen what the browser actually thought that button was called.

The browser already knows. Every page you load produces an accessibility tree alongside the DOM, and that tree is what NVDA, JAWS, VoiceOver and TalkBack read. Chrome, Edge and Firefox all let you inspect it directly in DevTools. Once you learn to open it, most "what does the screen reader say" bugs take five minutes instead of an afternoon, and you stop guessing.

What the accessibility tree is, and why the DOM is not enough

The DOM tells you what elements exist. The accessibility tree tells you what those elements mean to assistive technology: a role (button, link, heading, checkbox), an accessible name, sometimes a description, and a set of states such as expanded, checked or disabled. The browser computes that from your HTML, your ARIA attributes and some of your CSS.

The computation is where things go wrong. A div with a click handler appears in the DOM as a perfectly ordinary element, and in the accessibility tree as generic text with no role at all. An icon button with an SVG and no label appears in the DOM as a button containing an SVG, and in the tree as a button with an empty name. Elements hidden with display: none vanish from the tree entirely, while elements pushed off screen with absolute positioning stay in it. You cannot read any of that off the Elements panel.

Opening the accessibility pane in Chrome, Edge and Firefox

In Chrome and Edge, open DevTools with F12, select an element in the Elements panel, then look in the side pane next to Styles and Computed. There is a tab called Accessibility. If you do not see it, click the double arrow at the end of the tab row. It shows the computed role, the computed name, and a section called Computed Properties.

The more useful view sits at the top of that same pane: a checkbox labelled Enable full-page accessibility tree. Tick it, reload DevTools when asked, and a small accessibility icon appears in the top corner of the Elements panel. Click it and the DOM tree is replaced by the accessibility tree for the whole page. Click it again to switch back. I leave this on permanently in my QA profile.

Firefox has a separate Accessibility panel, and in some ways it is better. Open DevTools, choose Accessibility from the panel tabs (it may sit behind the overflow menu), and turn it on if prompted. You get the full tree on the left and the selected node's properties on the right. Firefox also has a Check for issues dropdown that flags contrast, keyboard and text label problems directly on nodes in the tree, which saves a step.

Safari has the least. Its Web Inspector shows role and label for a selected node in the Node sidebar under Accessibility, but no full tree view as of the versions I have tested.

Reading the computed name, and where it came from

The single most useful line in Chrome's pane is the Name row under Computed Properties. Expand it. Chrome lists every source it considered, in the order the accessible name computation spec checks them, and crosses out the ones it did not use.

The usual order runs like this: aria-labelledby first, then aria-label, then native labelling such as a label element or the alt attribute on an image, then the element's own text content for roles that take their name from content, and finally title as a last resort. If a button has both visible text and an aria-label, the aria-label wins, and Chrome shows the visible text struck through. That one view has ended more arguments in code review than anything else I know.

Back to the "button button" ticket. When we finally inspected it, the Name row showed aria-label set to "button". Someone had added a generic label as a placeholder during a refactor and forgotten it. The screen reader read the name, then the role. No amount of listening would have shown us that the string came from an attribute rather than from the icon. For more on labelling icon-only controls properly, see how to label accessible icon buttons.

Why you should not trust the Lighthouse score here

The common advice is to run Lighthouse or axe, fix what they report, and treat a high accessibility score as done. Automated checks are worth running, and I run them on every build. But for names and roles specifically, they answer a narrower question than people think.

Lighthouse checks that a button has a name. It cannot check that the name is right. A button labelled "button", "icon", "click" or "undefined" passes. A link whose accessible name is the full URL because the anchor text was missing passes. A product card where every "Add to cart" button has the identical name, so a screen reader user hears "Add to cart, Add to cart, Add to cart" with no product attached, passes too.

On a client audit last year, a page scored 98 in Lighthouse and still had 23 buttons whose names gave no clue what they did. We found every one by scrolling the full-page tree in about ten minutes. The tree shows you names as a list, and lists of bad names jump out in a way a score never will.

A ten minute pass on any page

This is the routine I teach new QA hires. It needs no screen reader installed and catches most naming and role problems before anyone files a ticket.

  1. Open the page in Chrome, turn on the full-page accessibility tree, and switch the Elements panel to tree view.
  2. Collapse everything, then expand the top-level landmarks. You should see banner, navigation, main and contentinfo. If main is missing, the page has no main landmark and screen reader users cannot jump to the content.
  3. Scroll the headings. Each should have role heading with a level. Skipped levels and headings whose names are empty or decorative are worth noting.
  4. Scan every node with role button or link and read its name out loud. Anything vague, duplicated or empty goes on the list.
  5. Look for nodes with role generic that you know are clickable in the UI. Those are div or span elements pretending to be controls.
  6. Open any disclosure, menu or tab set on the page and check that its state updates in the pane. A menu button should report expanded true after you open it and false after you close it.
  7. Pick two form fields and confirm each input shows a name that matches its visible label.

Ten minutes is honest for a typical marketing page. A dense dashboard takes closer to twenty-five. Either way it is quicker than a full screen reader pass, and it tells you exactly which attribute to change. It does not replace a real screen reader test before release, because announcement order, live regions and focus movement only show up when you actually listen.

If you want to go further with the panels, the DevTools features most developers never open covers a few more I rely on, and the rest of our accessibility guides go deeper on individual patterns.

FAQ

Does the accessibility tree match what every screen reader says?

Mostly, not exactly. Screen readers read the platform accessibility API the browser exposes, and each one adds its own phrasing and verbosity settings. The tree tells you the role and name. It does not tell you the exact words NVDA will speak.

Why does my element not appear in the accessibility tree?

Usually because it is hidden with display: none, visibility: hidden, aria-hidden="true" on it or an ancestor, or the hidden attribute. Some purely presentational elements are also pruned to keep the tree small.

Is the full-page tree slow on large pages?

On very large DOMs, yes, it can lag for a second or two when you switch views. I turn it off when profiling performance so it does not skew the numbers.

Can I use this view to test colour contrast?

Chrome shows contrast in the Styles pane colour picker, and Firefox flags it in the Accessibility panel's issue checker. The tree itself only covers role, name and state.

MC
Maren Castellanos

Maren worked in cross-browser QA before editing, and knows the DevTools Network tab better than most people know their inbox. She writes about how browsers load and render pages and about the tools that show what is really happening.

More posts by Maren

More in Accessibility

01doorganico 084goad 3hot8 4465456 after5internprogram ahandfulofblessings ahmadpc ahomcybersecurity allodialresources annodex antiquesandperiodcollectibles aotc asianworldkashmir beedlectrics bloggertemplatefree bluefeatheragency bodyweightsolution campaign08blog carfixadvisor catstreetcollective cbstvsports cnfanspurchasing committeeof500yearsofdignityandresistance covertopsdjs cs-kaiyuangame cuestacomunicaciontotal cxoutlet dancebetgame deskgearhub destinyvillastay detectmagazine di33 diamondsteelbuildings donmo dyanadropship emarsysfinance emimattl escapechan eskitarih evautoplay everythingweddings-orlando farmzone feedviewerapp foxstudiosscratch gamevui123 gleasongrade greetingsday hacklabasu haskell iw-kaiyun jagoanproperti jilidskripsi joltbusinessfinance juegodepokergratis juegospucca kaeru-festival latestmehndidesigns lestanzediottaviano litemagazines localcommunityhero lustrsazan mariashebets menswheels newwebstechs1 nikkit ootheday oxigenvpn plurfitness prefetial probudgetcarpetcleaning psychicmrsmartin pyaten qvantor rejoignezlogis rexzbot riselayouts ruchin rwxqsgd5 sakaltime shibiaowang shop-bot skrtips spotlesshaven strcoding tetapatrium topselller uneplanteartificielle vipertechcr wo-kygaming yamaha-mekar yeknava yoybuysheets zenunwa yamaha-mekar jilidskripsi ankertoto ankertoto ankertoto