Accessibility fundamentals

Keyboard operability, focus management, visible focus, ARIA roles/states, testing with a real screen reader. Big Tech loops fail candidates on this alone.

About 28 min read3-question knowledge check

The mental model

Accessibility is building the page so that the same task can be completed without the sense or ability you happened to assume the user had. A sighted mouse user, a blind screen-reader user, and someone navigating by keyboard because a tremor makes a mouse impossible must all be able to buy the thing, submit the form, and read the article.

The analogy that reframes it: a building has a front door with steps and a ramp beside it. The ramp is not a charity add-on — it is how the person with a wheelchair, the parent with a stroller, and the delivery worker with a trolley all get in. On the web, semantic HTML *is* the ramp, and it is free: a real <button> is already operable by keyboard, already announced correctly by a screen reader, already focusable, already in the tab order. You get all of that by not throwing it away.

**Why this exists — what breaks without it.** The browser exposes a second, invisible interface called the **accessibility tree**: a parallel model of the page that assistive technology reads instead of pixels. When you write a real <button>, the browser puts a node in that tree with role "button", the label from its text, and a state. When you write <div onclick>, the browser puts a node with role "generic", no name, no state, and no keyboard behaviour — the screen reader announces nothing useful and the keyboard cannot reach it. Nothing looks wrong on screen. Everything is wrong in the tree. Every accessibility bug is, at bottom, a divergence between what the pixels say and what the accessibility tree says.

The single rule that prevents most of it: **use the native element first, reach for ARIA only when no native element expresses what you need.** ARIA changes the accessibility tree but adds *zero* behaviour — role="button" does not make Enter work, does not make the element focusable, does not do anything except relabel a node. This is why the first rule of ARIA is "don't use ARIA."

The full lesson continues with 15 more sections
  • Deep dive
  • Internal architecture
  • Real-world use cases
  • Best practices
  • Common mistakes
  • Performance
  • Security
  • Production troubleshooting
  • Advantages & disadvantages
  • Alternatives
  • Interview expectations
  • Interview questions
  • Facts to remember
  • Cheat sheet
  • Quick revision