ARIA textbox Role
The textbox role marks a custom field where the user can type free-form text. The input and textarea elements have this role.
Description
The textbox role identifies an input that allows free-form text. It can be single-line or, with aria-multiline="true", multi-line. Native <input> elements of text-like types, and <textarea>, have this role.
The role is mainly needed for custom editors built with contenteditable, such as rich-text editors. Those must still have a label, report states such as aria-required and aria-invalid, and handle features like copy and paste correctly. A contenteditable element doesn't take part in form submission, so its content has to be copied into the form with script.
For plain text, the native elements are far simpler and more robust.
Use the native HTML <input>, <textarea> element where you can: it already has the textbox role, with the expected keyboard and browser behavior built in.
Properties
- Category
- Widget
- HTML equivalent
<input>,<textarea>- Accessible name from
- author
- Required parent role
- None
- Required child roles
- None
ARIA Attributes
- Required
- None
- Supported
aria-activedescendant,aria-autocomplete,aria-errormessage,aria-haspopup,aria-invalid,aria-multiline,aria-placeholder,aria-readonly,aria-required- Prohibited
- None
- Global
- All global ARIA attributes can also be used, such as
aria-label,aria-labelledby,aria-describedby,aria-hidden.
Syntax
<element role="textbox">
Example
Browser Support
The following information will show you the current browser support for the textbox ARIA role. Hover over a browser icon to see the version that first introduced support for this ARIA role.
Desktop





Tablets & Mobile





