Your HTML pinned on the Balai’s board: the accessibility tree is recomputed from its real DOM on every change, Mr. Sugeng walks it node by node, and Bayu’s…
Screen readers, voice control, even Testing Library (getByRole) all find elements by role and name in this tree. Wrong markup turns a button into "generic", leaves an image nameless, or drops focus onto something that does not exist. Knowing the tree means no more guessing at ARIA.
Screen readers read the accessibility tree, not the raw DOM
<div onclick> Its role is generic, Tab cannot reach it, and the SR never says "button". Use <button>: the role, focus, Enter and Space come for free.<img> without alt Its name is empty, and some screen readers then read the file name. Give an alt that says what it shows, or alt="" if it is decoration (pruned from the tree).aria-label that replaces the visible text, role="button" on a link, role="checkbox" with no aria-checked and no focus. Use semantic elements first; ARIA only for what HTML lacks.aria-hidden="true" on something Tab can reach The node leaves the tree, yet focus still lands there and the SR has nothing to read. Add tabindex="-1" (or inert on the container), or do not hide interactive elements.<div onclick> Step forward to its node, or tap the div on the board. Mr. Sugeng only hears "Send": its role is generic, and Tab never stops there.aria-label on the <button>, or add a <span class="sr-only">. Its getByRole query in the code changes with it.opacity: 0 and sr-only vanish from Wulan’s eyes, yet Mr. Sugeng still hears them. aria-hidden is the reverse: visible, but not read.