ARIA Widget Roles
ARIA role: textbox
An editable text entry field. Prefer input type=text or textarea. Custom textbox needs a name and real editing behavior; aria-multiline describes multiline semantics. The example demonstrates a native equivalent or preferred alternative and deliberately omits redundant ARIA. Explicit roles do not implement visual presentation, interaction or focus management; verify allowed role/element combinations in ARIA in HTML. Accessibility exposure varies with browser, platform and assistive technology. Test relevant combinations; rendering is not proof of accessibility.
Formal Syntax & Structure
html syntaxhtml
role="textbox"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| role | token | Explicit role token textbox; use only where allowed. Omit when native semantics match. |
| aria-multiline | boolean | Relevant when applicable. Describes whether a textbox accepts more than one line. It does not enable line breaks itself. Prefer textarea for multiline editing; implement appropriate Enter behavior in custom controls. Values: true, false. |
| aria-readonly | boolean | Relevant when applicable. Indicates that a value cannot be edited but can generally still be read or interacted with. It does not prevent editing itself; use native readonly on supported text controls or enforce read-only behavior in a custom widget. Values: true, false. |
| aria-required | boolean | Relevant when applicable. Communicates that user input is required before submission. It does not enforce validity, so prefer native required where supported and implement validation for custom controls. Provide visible instructions as well. Values: true, false. |
Working Example
Example Snippethtml
<label for="comment">Comment</label><textarea id="comment"></textarea>