Skip to content
easeweb

Rules of thumb

When a guide offers more than one fix and recommends one, the reason is usually one of these. Each rule lists the guides that rely on it.

Use native HTML first

When an HTML element does the job, use it, and reach for ARIA only when none does.

Why

  • Behaviour comes with the element. A button responds to Enter and Space, a label puts focus in its field when clicked, and a dialog opened with showModal() keeps focus out of the page behind it. With a div and ARIA, you write each of those yourself, and they are easy to leave out.
  • ARIA changes what is announced, not what happens. role="button" makes a screen reader say "button", but the element still ignores the keyboard until you add the code. A screen reader user is told one thing and gets another.
  • Native elements work in more places. Browser autofill, voice control, forced colors, reader views and older assistive technology all understand label, button and select. Support for ARIA roles and attributes is uneven across them.
  • There is less to keep working. Browsers maintain native behaviour and fix it for you. Hand-written ARIA and its scripts break silently when markup is renamed, a component is updated or a script fails to load.
Prefer
<label for="phone">Phone</label>
<input id="phone" type="tel">
Over
<div id="phone-label">Phone</div>
<input type="tel" aria-labelledby="phone-label">
Guides that rely on it (63)

Sources

Make motion opt-in

Write every CSS animation and transition that moves something inside @media (prefers-reduced-motion: no-preference), so movement is added for people who have not asked for less, never removed afterwards.

Why

  • Nothing can be forgotten. An override under prefers-reduced-motion: reduce has to name every animation again, and the next one someone adds will not be on the list. Motion that only exists inside no-preference is off by default.
  • It also covers browsers and devices that cannot report the setting. They match neither query value, so they get the still page, which works for everyone.
  • The resting state is the real one. Content that starts hidden or off-screen only inside the query can never be stuck there for people who reduced motion.
  • It respects a choice the visitor has already made once, in their system settings, for every site. Vestibular disorders, migraine and concussion make large movement physically unpleasant, and many people turn the setting on for that reason.
Prefer
@media (prefers-reduced-motion: no-preference) {
  .panel { transition: transform 300ms; }
}
Over
.panel { transition: transform 300ms; }
@media (prefers-reduced-motion: reduce) {
  .panel { transition: none; }
}

Guides that rely on it

Sources

Let people stop anything that moves by itself

When something would move, scroll, blink or change by itself for more than five seconds beside other content, such as a ticker, a carousel or a looping animation, either let it change only when someone asks, or put a button before it that stops it and keeps it stopped; pausing on hover or focus is neither.

Why

  • Movement pulls the eye. People with attention difficulties keep being drawn back to it and lose their place in what they were reading, and nothing the page offers lets them make it stop.
  • Moving text runs ahead of slow readers and magnifier users. A message that slides away or a slide that changes after six seconds is gone before they finish it.
  • Hover and focus are not a way to stop it. A pause on hover needs a mouse and ends when the pointer moves; a pause on focus ends when focus moves. Keyboard, touch and voice users get nothing, and the movement comes back the moment anyone looks away.
  • Not moving at all is the simplest way to meet it. Content that changes only when someone presses a button needs no Stop control, and no one has to find one.
  • A real button reaches everyone. A native button before the moving content is the first thing the keyboard meets, a screen reader names it, voice control can say it, and it stays stopped until someone presses it again.
  • The reduced-motion setting helps but is not enough. Not everyone who is distracted by movement knows it is there, and some use a computer they cannot change, so the page needs its own control as well.
Prefer
<button type="button" aria-pressed="false">Pause announcements</button>
<div class="ticker">…</div>
Over
<div class="ticker">…</div>

.ticker:hover .ticker-track { animation-play-state: paused; }
Guides that rely on it (4)

Sources

Move to show a change, then stop

Let something move when the movement shows what changed, such as a bar filling to its new value, a panel opening or an item sliding to its new place, and let it stop when the change does; motion that only decorates, such as a shimmer, a pulse or stripes on a finished bar, either stops within five seconds or doesn’t run.

Why

  • Motion that tracks a change carries information. A fill that grows shows how far an upload has got, and a panel that slides open shows where its content came from. It ends when the change ends, so it never competes with what people read next.
  • Decorative motion keeps going after there is nothing left to tell. A shimmer on a link, a pulsing button or stripes sliding on a finished bar pull the eye away from the content for as long as the page is open, which is what makes reading hard for people with attention difficulties.
  • Five seconds is the line WCAG draws. Anything that moves by itself beside other content for longer than that needs a way to pause, stop or hide it, so decoration that stops sooner needs no control at all.
  • A loading animation is the one exception, and a narrow one. It counts as essential only while nothing else on the page can be used and the motion is what shows the page hasn’t frozen. Once people can carry on with the page, or the load is done, it is decoration again.
  • Meaningful motion is still opt-in. The change must also show without movement, in the new value, the open panel or the new position, so the animation can sit inside prefers-reduced-motion: no-preference and nothing is lost when it doesn’t run.
Prefer
.fill { width: 60%; }
@media (prefers-reduced-motion: no-preference) {
  .fill { transition: width 0.4s ease-out; }
}
Over
.bar.done .fill {
  animation: stripes 1s linear infinite;
}
Guides that rely on it (15)

Sources

Flash no more than three times a second

Keep anything that flashes, at any size, to three flashes or fewer in any one second, or don't flash at all, rather than counting on the flash being small or dim enough to pass the thresholds.

Why

  • A seizure can start before anyone can act. W3C notes that turning a flash off is not an option, because a seizure could come faster than most people could turn it off, so a warning or a Pause button comes too late.
  • Three a second needs no measuring. WCAG notes that no tool is needed when nothing flashes more than three times in any one second; the size and brightness thresholds need a flash analysis tool, and must hold at the largest size anyone views the page.
  • Size depends on the viewer, not the author. Zoom, a screen magnifier or a phone held close make a small flash cover more of what someone sees, so a flash that passes on the designer's screen can fail on someone else's.
  • Most seizures come from faster flashing. Flashes between 3 and 30 a second are the most common trigger and sensitivity below three a second is uncommon, so the rule stays clear of the range that matters.
Prefer
@media (prefers-reduced-motion: no-preference) {
  .sale { animation: blink 1s steps(1) 3; }
}
Over
.sale { animation: blink 0.2s steps(1) infinite; }

Guides that rely on it

Sources

Show a message next to what it is about

Put a status or error message beside the field, button or content it reports on, not in a corner of the page.

Why

  • Magnifier users see only part of the screen. Someone zoomed in on the field they are typing in never sees a toast in the far corner, and it may be gone before they could pan to it.
  • Nearness says what the message belongs to. People read things placed together as related, so "Saved" under the editor is clearly about the editor, while the same word in a corner could be about anything.
  • People are already looking there. A message beside the thing they just used is seen without searching, so they can act on it at once instead of hunting for it or returning to what they thought was done.
  • It can stay. A message in its own place can remain until it is out of date, so people can read it again; a toast in a shared corner has to go to make room for the next one.
Prefer
<textarea id="note"></textarea>
<p role="status">Draft saved at 10:42.</p>
Over
<textarea id="note"></textarea>
…
<div class="toast-corner" role="status">Saved</div>
Guides that rely on it (8)

Sources

Interrupt only for what can't wait

Send routine news, such as saved, added, updated or a new comment, to a polite status region that waits for the screen reader to finish, and keep role="alert" and aria-live="assertive" for a message people must act on now, such as a lost connection or a failed payment.

Why

  • An assertive message can cut in. ARIA gives it the highest priority, to be presented immediately, and lets the screen reader drop the messages that were waiting. VoiceOver does cut in, on macOS and iPadOS, breaking off whatever the person was listening to.
  • W3C counts it as a failure. Understanding 4.1.3 lists role="alert" or aria-live="assertive" on content that is not important and time-sensitive among its failures, and says status messages should reach people without unnecessarily interrupting their work.
  • Urgency only works when it is rare. When every notice interrupts, the one that matters sounds like all the others, and JAWS and Narrator read alerts like any other message anyway, so its words have to say it is urgent; MDN warns that the alert role is intrusive and must be used sparingly, and that several alerts at once make for a bad experience.
  • Polite messages are still heard. A status region is read as soon as the screen reader finishes what it is saying, so routine news reaches people a moment later and nothing they were reading is lost.
Prefer
<p id="notice-status" role="status"></p>
<p id="notice-alert" role="alert"></p>
<!-- "Sam opened this task" → status; "Connection lost" → alert -->
Over
<div id="notices" role="alert"></div>
<!-- Every notice, routine or not, goes here. -->
Guides that rely on it (5)

Sources

Say it once, when the change has settled

When something changes in steps, such as a field being typed in, a count going down or a reply streaming in, write its message into the live region once the change has settled (typing has paused, a limit is near, the reply is complete), not at every step.

Why

  • Every write is a message. A live region reports each change to its content, so a count written on every keystroke, or a reply written a few words at a time, reaches people as a run of fragments that queue up behind each other or are dropped half read.
  • A message sent too early is already out of date. An error for an address still being typed, or a count two keys behind, reports a state the person was about to change. Nielsen Norman Group calls it frustrating to see an error before being given the chance to finish typing.
  • The W3C's own examples wait. The WAI forms tutorial checks a username as it is typed and has its message read once, when the person stops typing, and ARIA describes aria-busy for changes to a live region made in steps that should be spoken as one unit when they are complete. Screen readers don't all honour aria-busy, so writing the message once is the dependable way.
  • Settled is not silent. Something is still said at the end: the result of the check, the count as the limit nears, the whole reply. GOV.UK's character count is announced when people stop typing. Waiting decides when a message is read, not whether.
Prefer
const sayCount = debounce(() => {
  status.textContent = `${left} characters left`;
}, 1000);
field.addEventListener('input', sayCount);
Over
field.addEventListener('input', () => {
  status.textContent = `${left} characters left`;
});
Guides that rely on it (4)

Sources

Style from the state, not a class

Draw a control's current, open, pressed or invalid look from the attribute that tells assistive technology that state, not from a separate class.

Why

  • The look and the announcement cannot disagree. When the style selects on aria-current, aria-expanded or aria-pressed, the state a screen reader announces and the state people see come from one value, so they cannot end up on different elements.
  • A missing attribute shows. If the code forgets the attribute, the style is missing too, so a sighted tester sees the bug. With a separate class, the page can look right while the state is silent, and only a screen reader test finds it.
  • There is one thing to update. A script or template that changes the state sets one attribute, instead of a class and an attribute that have to be kept in step.
  • Screen readers speak the state in the user's own language. A state attribute such as aria-current needs no extra words in the page, so there is nothing to write, translate or keep hidden.
Prefer
<a href="/pricing" aria-current="page">Pricing</a>

a[aria-current="page"] { font-weight: bold; }
Over
<a href="/pricing" class="active">Pricing</a>

a.active { font-weight: bold; }
Guides that rely on it (20)

Sources

Keep words as text

When words carry information, such as a heading, an offer, a date or a warning, put them on the page as real text styled with CSS, not inside an image; alt text gives screen readers the words, but nobody else can resize, recolour or translate them.

Why

  • Readers can change text and can't change a picture. A larger text size, a different font, wider spacing, their own colours or a dark theme all reach real text, and none of them reach the pixels of an image.
  • Text stays sharp and fits. It is drawn afresh at every size and wraps to the width of the screen, while an image of text blurs when zoomed and shrinks with the layout on a phone.
  • More tools can use it. Browser translation, find in page, copy and paste, reading tools that highlight words as they speak, and search engines all work on text, and skip an image whatever its alt says.
  • It is cheaper to keep right. Changing a date or a word is an edit, not a new image from a design tool, so the page and its text alternative never drift apart.
Prefer
<table>
  <tr><th>Size</th><th>Chest</th></tr>
  <tr><th>M</th><td>102 cm</td></tr>
</table>
Over
<img src="size-chart.png" alt="Size M: chest 102 cm…">
Guides that rely on it (4)

Sources

Hide things from everyone at once

When something is out of view or out of use, hide it from sight, the keyboard, the pointer and screen readers together, with hidden, display, visibility or inert, not from one of them.

Why

  • aria-hidden hides from screen readers only. The element stays in the tab order and can still be clicked, so a keyboard user can land on something a screen reader won't describe, and the person hears nothing, or less than the page shows.
  • Moving something off screen, or fading it to nothing, hides it from sight only. Tab still stops on its links and a screen reader still reads them, so people reach things nobody can see.
  • One switch covers everything inside. hidden, display: none, visibility: hidden and inert apply to every descendant, including links and fields added later, so there is no tabindex to set and reset on each one.
  • The browser keeps it working. These are HTML and CSS that every current browser enforces, with nothing for a script to forget when the content changes.
Prefer
<!-- The closed menu, out of view -->
<nav id="menu" class="drawer" inert>…</nav>
Over
<!-- The closed menu, out of view -->
<nav id="menu" class="drawer" aria-hidden="true">…</nav>
Guides that rely on it (4)

Sources

Explain instead of disabling

Leave a button that can't do its job yet working, and when it is pressed, say what is missing next to the cause, rather than greying it out.

Why

  • A disabled button says no, but not why. People have to guess which field or box is holding it back, and the guess is hardest for those who see only part of the page or can't see it at all.
  • Disabled buttons drop out of the Tab order. A keyboard or screen reader user moving with Tab never lands on them, so they may not know the button exists, let alone that it is waiting for something.
  • Disabled buttons are usually drawn faint. Browsers and WCAG let disabled controls have any contrast, so the button and any hint in it are hard to read for people with low vision.
  • Pressing gives an answer. An enabled button that shows the error beside the field that caused it tells people exactly what to fix and takes them there, with the same error handling the form needs anyway.
Prefer
<button type="submit">Place order</button>
<!-- On submit: show "Tick the box to accept the terms" beside the box -->
Over
<button type="submit" disabled>Place order</button>

Guides that rely on it

Sources

Make a gesture a shortcut, never the only way

A right-click, a long press, a swipe, a pinch, a drag or a tilt of the phone can speed up an action, but the same action also needs a control people can see, reach with Tab and press once.

Why

  • Gestures are invisible. Nothing on a row says it opens a menu when right-clicked or reveals a Delete button when swiped, so people who don't guess the gesture never find the action.
  • The keyboard can't make them. Tab, Enter and Space reach buttons and links, not a pointer held still or moved along a path, so keyboard, switch and voice control users are left with no way in.
  • Not everyone can hold or aim a pointer. A long press slips into a scroll for someone with a tremor, and a swipe has to follow a path that a head pointer or a mouth stick can't trace.
  • Not every phone moves as its owner means it to. A phone fixed to a wheelchair mount can't be tilted, and one in a shaking hand or on a bus tilts all the time, so an action tied to motion needs a button and a way to switch the motion off.
  • Platforms differ. A touch screen has no right-click, iOS Safari fires no context menu event on a long press, and on a Mac only a screen reader command opens one from the keyboard. A button works the same everywhere.
Prefer
<li>
  Invoice March.pdf
  <button type="button">Delete</button>
</li>
<!-- A swipe or right-click on the row can delete it too -->
Over
<li oncontextmenu="openMenu(event)">Invoice March.pdf</li>
Guides that rely on it (21)

Sources

Keep the text alternative beside what it stands for

Put a transcript, a description of a video, the data behind a chart or the places on a map on the same page, right beside what it stands for, rather than on a page of its own.

Why

  • Everyone who finds the original finds the text. Nobody has to notice a link, guess what it leads to or land on a separate page with no context, and a screen reader reaches the words straight after the player.
  • More tools reach it. Find in page, browser translation, reader views and search engines read the text along with the rest of the page, and people who read along while they listen don't have to switch between two pages.
  • It stays in step. When the recording is replaced or the video re-cut, its text is on the same page and gets edited in the same change. A transcript on a page of its own is easy to forget, and a broken or stale link leaves the media with no alternative at all.
  • It can still stay out of the way. A long text can sit in a details element under the player, closed until someone opens it, and still be on the page.
Prefer
<audio controls src="episode-4.mp3"></audio>
<details>
  <summary>Transcript</summary>
  <p><b>Alex:</b> …</p>
</details>
Over
<audio controls src="episode-4.mp3"></audio>
…
<footer><a href="/transcripts">Transcripts</a></footer>
Guides that rely on it (6)

Sources

Write the source in the order it is read

Put content and controls in the markup in the order people read and use them, and let CSS arrange that order on screen without changing it.

Why

  • The markup is the only order most tools see. Screen readers, braille displays, read-aloud tools, the Tab key, reader views and pages printed or copied with styles off all follow it, and none of them follow a float, order, grid placement or row-reverse.
  • One order means one experience. When the source and the screen agree, a sighted colleague, a keyboard user and a screen reader user meet the same amount after the same name and the same button first, and can describe the page to each other.
  • It survives the next layout. A phone layout, zoom, a user style sheet or a redesign can move things on screen, but a source written in reading order still reads correctly underneath. Order fixed up in CSS has to be fixed again at every breakpoint.
  • There is nothing extra to keep in step. Hidden labels, positive tabindex values and other patches that make up for a jumbled source each need updating whenever the content changes, and break silently when one is missed.
Prefer
<li><span>Canvas tote</span> <span class="amount">$28</span></li>

li { display: flex; justify-content: space-between; }
Over
<li><span class="amount">$28</span> Canvas tote</li>

.amount { float: right; }
Guides that rely on it (5)

Sources

Write labels and link text that make sense on their own

Give each form field a label, and each link its text, that says what it is for when read by itself, without the heading, the sentence, the picture or the layout around it, because that is how much of the time it is read.

Why

  • Links are read in a list. Screen readers can list every link on a page, and Tab moves from link to link, so "click here", or three links all called "Care guide", say nothing about where each one goes, even when the line around each link does.
  • Screen readers read the label alone. Moving through a form with Tab, people hear each field's label as it takes focus, and the text between the fields is usually skipped, so a heading or a preview that explains "Name" never reaches them.
  • A magnifier shows one field at a time. Under high zoom, the label and its field may be all that is in view, and the heading that gave the label its meaning is off screen.
  • The label is reused elsewhere. Error messages, error summaries, review pages and a screen reader's list of form fields all quote it without its surroundings, and "Enter a name" or "Email: required" says nothing about whose.
  • Voice control works from the words people see. They say the label to reach a field, so the clearer the visible words, the easier the field is to name, and two fields that share one word can't be told apart.
Prefer
<label for="name">Recipient's name</label>
<input id="name" name="recipient-name" type="text">
Over
<h2>Who it's for</h2>
<label for="name">Name</label>
<input id="name" name="recipient-name" type="text">
Guides that rely on it (4)

Sources

Read the order back before it is final

Before a step that spends money, signs people up to something, publishes what they wrote or deletes what they made, show them what they chose, in words, with a way to change each part, and only then ask them to confirm.

Why

  • Most costly mistakes are valid. Two tickets instead of one, or Saturday instead of Friday, pass every check a form can run, so validation can't catch them; only the person can, and only if they are shown.
  • A form is never seen whole. People who zoom in, use a screen reader or fill it in on a phone meet it one field at a time, and a choice made several fields earlier is out of sight by the time they press Pay.
  • Stopping a mistake is cheaper than undoing it. A review costs one page, while a refund holds people's money for days, needs a process behind it, and only helps those who notice in time.
  • It answers what software misheard or a hand slipped on. Voice input, switches and tremors all produce choices people didn't mean, and a read-back is where they find out.
Prefer
<h1>Check your booking</h1>
<dl>
  <dt>Tickets</dt>
  <dd>2 <a href="/book#tickets">Change</a></dd>
</dl>
<button type="submit">Confirm and pay $48</button>
Over
<input id="tickets" name="tickets" type="number" value="1">
<button type="submit">Pay now</button>
Guides that rely on it (5)

Sources

Open links in the same tab

Let a link open where people already are, in the same tab, and leave opening it elsewhere to them; when a page really needs a new tab, say so in the words of the link.

Why

  • Back keeps working. A new tab starts with no history, so in many browsers Back does nothing there, and the way back is a tab that people have to know is there and then find.
  • Not everyone sees a tab open. A screen reader reads out the new page, a magnifier shows only the part of the screen it is on, and on a phone the old page waits out of sight in another tab. People think the site has replaced their page, or lost it.
  • People can already choose. Desktop browsers open a link in a new tab on a middle click, on Ctrl or Command and a click, or from the context menu, and phone browsers offer it on a long press. A site that forces a new tab takes that choice away from everyone.
  • A warning lets people decide. Where a new tab helps, such as help beside a form that is half filled in, words in the link tell everyone before they press it, so they can plan their way back.
Prefer
<a href="/size-guide">Size guide</a>
Over
<a href="/size-guide" target="_blank">Size guide</a>

Guides that rely on it

Sources

Say it in words, not only in the styling

When the way text is drawn carries meaning, such as a line through an old price, a word marked as new or a change shown in red and green, write that meaning in words too, beside it, rather than leaving it to the styling.

Why

  • Styling isn't read aloud. Screen readers and read-aloud tools speak the text, and a line-through, a colour or a weight set in CSS isn't part of it, so two prices are read as two prices.
  • Markup alone depends on the reader. Elements such as s, del and ins do tell assistive technology what the text is, but whether a screen reader says so depends on the screen reader and its settings; a word is read the same in all of them.
  • A style has to be known to be understood. A line through a price means "no longer" only to people who know the convention, and a word such as "was" says it outright.
  • Not everyone sees the styling either. A colour vision deficiency, glare or a Windows contrast theme takes a red and a green away, and text hidden for screen readers doesn't bring them back to the eye; a word on the screen survives all three.
Prefer
<p class="price">
  Was <span class="old">$40</span>
  Now $28
</p>
Over
<p class="price">
  <span class="old">$40</span>
  $28
</p>

.old { text-decoration: line-through; }
Guides that rely on it (7)

Sources

Convert what people type instead of rejecting it

When a value is right but written in a different form from the one you store, such as digits typed at full width or a number with spaces in it, convert it yourself rather than asking the person to type it again.

Why

  • The value is already right. A phone number in full-width digits or with hyphens is the same number, and an error makes a correct answer look wrong.
  • The difference is easy to miss. Full-width and half-width digits differ mainly in the space each takes, so a person told the number is invalid looks at their digits and finds nothing to fix.
  • One line of code saves everyone a retype. Converting is done once, in one place, and a rejection costs every person who meets it another try, more for those who type slowly or with an input method.
  • Checking still happens. The converted value is checked as before, on the page and on the server, so a value that is really wrong is still refused, with a message that says what to change.
Prefer
const digits = tel.value.normalize('NFKC').replace(/[\s\-‐−ー]/g, '');
const valid = /^[0-9]{10,11}$/.test(digits);
Over
const valid = /^[0-9]{10,11}$/.test(tel.value);
// "Enter a valid phone number."

Guides that rely on it

Sources

Change the page only when people ask

Take people to another page, open a pop-up over what they are doing, close what they are using, load more, start sound or end their session only when they press something that says it will, such as Apply, Play, Load more or Close, not on a timer, when a value changes or when focus moves; where a time limit has to stay, warn people before it ends and let one press extend it.

Why

  • A change people didn’t cause is easy to miss. A screen reader or magnifier user picking an option, tabbing through a panel or reading a confirmation is not watching the rest of the screen, so a new page, a closed panel or a list that grew ahead of them leaves them somewhere they didn’t choose, with nothing to say how they got there. W3C names people with low vision, people with motor impairments and people with some cognitive disabilities among those these changes confuse.
  • Passing through is not choosing. On a keyboard, the arrow keys step through a menu’s options one value at a time, and Tab passes through a panel on the way to its results. A page that acts on each new value or each move of focus acts on choices people were only passing.
  • A timer is a deadline nobody agreed to. Reading, typing or moving more slowly, or stopping to do something else, is enough to miss it, and a page that moves on or signs people out takes away what they were reading or had entered.
  • Sound the page starts competes with the screen reader. People who hear the page through speech find it hard to follow that speech over a soundtrack, often on the same volume control, and the way to stop it is something they have to find by listening.
  • A button says what will happen before it happens. Apply, Load more or Keep me signed in tells people what pressing it does, reaches the keyboard, screen readers and voice control alike, and makes the change when people are ready, where they expect it.
  • When a limit has to stay, a warning is the next best thing to asking. A message people meet at once, before time runs out, with one press to extend it, gives the choice back to them, and WCAG asks for at least 20 seconds to make it.
Prefer
<label for="sort">Sort by</label>
<select id="sort" name="sort">…</select>
<button type="submit">Apply</button>
Over
<label for="sort">Sort by</label>
<select id="sort" name="sort" onchange="this.form.submit()">…</select>
Guides that rely on it (11)

Sources

Name things by pointing at the words on screen

When the words that name a control, a region or a table are already shown, such as a field’s label or a section’s heading, make that text its name, with a label element, a caption or aria-labelledby, rather than writing the same words again in aria-label.

Why

  • There is one copy of the words. Reword or translate the label, and the name changes with it. A second copy in aria-label is invisible on screen, so nobody notices when the two drift apart, and W3C notes that hidden names are more likely to go out of date.
  • Everyone gets the same words. A screen reader reads the label people see, and voice control acts when someone says "Click" and that label, which WCAG 2.5.3 asks for. A copy that lacks one of the label’s words already breaks the second.
  • It shows in review. A label element or an aria-labelledby id points at text you can see in the markup and on the page; a copied aria-label has to be compared by hand with what the page shows.
Prefer
<div id="message-label">Message</div>
<div role="textbox" contenteditable="true" aria-labelledby="message-label"></div>
Over
<div>Message</div>
<div role="textbox" contenteditable="true" aria-label="Message"></div>
Guides that rely on it (9)

Sources

Explain a word where it is used

When a page uses a word its readers may not know, such as a trade term, an abbreviation or an idiom, write what it means on the page right beside it, in brackets or in the same sentence, rather than leaving it to a tooltip, a glossary or a help page.

Why

  • People don't look up a word they think they know. A trade term often looks like an everyday word ("excess", "mode"), so readers take the everyday meaning and never think to ask; W3C tells of someone with dementia who could not use a heating unit because one menu said "mode".
  • It reaches everyone. Words on the page are read by a keyboard user, on a touch screen and by a screen reader alike, while a tooltip shown on hover needs a mouse, which the HTML standard warns leaves out keyboard and touch users.
  • It stays in view. People who zoom in see a small part of the page at a time, and a meaning beside the word is in that part; one at the foot of the page or on another page takes them away from the sentence they were reading.
Prefer
<p>Excess (the most you pay towards damage): 1,000.00</p>
Over
<p><span title="The most you pay towards damage">Excess</span>: 1,000.00</p>
Guides that rely on it (4)

Sources