Skip to content

Input button without text

a11y-input-button-namecritical
On this page

Why it matters

  • Some older themes and form builders write buttons as <input type="button">, type="submit" or type="reset", with the button's text in its value. When the value is empty, or missing on a plain button, the button shows no text and a screen reader announces only "button".
  • WCAG 2.2 asks that every control has a name that assistive technology can read (success criterion 4.1.2, level A).

Example

Wrong
<input id="more" type="button" />
Right
<input id="more" type="button" value="عرض المزيد" />

How to fix

  • Write the button's text in its value, in the page's language: <input type="button" value="عرض المزيد">.
  • Or use <button type="button">عرض المزيد</button>, which has room for an icon beside the text.

How we detect

  1. We render the page and run axe-core 4.13.0's input-button-name rule in each engine.
  2. It reports each <input> of type button, submit or reset without an accessible name: an empty value, or none on a button, and no aria-label, aria-labelledby or title.
  3. A submit or reset button with no value at all is not reported, because the browser gives it a word of its own, which may not be in the page's language. Write a value in Arabic all the same.
  4. It does not apply to pages without buttons of this kind. <button> elements are checked by another axe rule, which Arablyzer also reads.