Semantics

A type of input that allows free-form text as its value.

Additional info from the ARIA specification

If the aria-multiline attribute is true, the widget accepts line breaks within the input, as in an HTML textarea. Otherwise, this is a simple text box. The intended use is for languages that do not have a text input element, or cases in which an element with different semantics is repurposed as a text field.

Authors MUST limit the children of a textbox to non-interactive, entirely presentational elements such as icons used to visually convey information that is already exposed in an accessible manner. Examples include:

Abstract Role

  • WidgetRepresents a focusable, interactive element.

Content Category

Only Used with Specific Parent Roles

This role must be a direct descendant of one of the following roles:

Allowed Descendants

Flow Children Allowed

No main element descendants allowed.

Usage

Allowed HTML elements

Implicit semantics

These elements have the role semantics by default, without needing to set the role attribute. Reach for elements with native semantics first when choosing how to implement a role in your content.

  • input­[type=­text]
  • textarea

Explicitly allowed

  • None

Elements that can have any role

  • abbr[role=textbox]
  • address[role=textbox]
  • b[role=textbox]
  • blockquote[role=textbox]
  • canvas[role=textbox]
  • cite[role=textbox]
  • code[role=textbox]
  • custom-element[role=textbox]
  • data[role=textbox]
  • del[role=textbox]
  • dfn[role=textbox]
  • div[role=textbox]
  • em[role=textbox]
  • figure[role=textbox]
  • i[role=textbox]
  • ins[role=textbox]
  • kbd[role=textbox]
  • mark[role=textbox]
  • output[role=textbox]
  • p[role=textbox]
  • pre[role=textbox]
  • q[role=textbox]
  • samp[role=textbox]
  • small[role=textbox]
  • span[role=textbox]
  • table[role=textbox]
  • tbody[role=textbox]
  • tfoot[role=textbox]
  • thead[role=textbox]
  • time[role=textbox]
  • u[role=textbox]
  • var[role=textbox]