Main content

aria-readonly

Characteristics

Type:

  • String

Related Concepts:

  • XForms
  • Readonly

See Related:

  • aria-disabled

Used in Roles:

  • grid
  • gridcell
  • textbox

Inherits into Roles:

  • columnheader
  • rowheader
  • treegrid

Value:

  • true/false
    • true: The user cannot change the value of the element.
    • false (default): The user can change the value of the element.

Sets or retrieves the read-only state of this element.

This means the user can read but not set the value of the widget. Readonly elements are relevant to the user, and application authors should not restrict navigation to the element or its focusable descendants. Other actions such as copying the value of the element are also supported. This is in contrast to disabled elements, to which applications might not allow user navigation to descendants.

Examples include:

  • A form element which represents a constant.
  • Row or column headers in a spreadsheet grid.
  • The result of a calculation such as a shopping cart total.

Note  For cross-browser compatibility, always use the WAI-ARIA attribute syntax to access and modify ARIA properties, for example object.setAttribute("aria-valuenow", newValue).

Syntax

HTML
<element aria-readonly="p" ... >
JavaScript
object.setAttribute("aria-readonly",value);var value = object.getAttribute("aria-readonly");

Microsoft Active Accessibility Properties:

  • STATE_SYSTEM_READONLY (get_accState)

UI Automation Properties: 

  • IsReadOnly

UI Automation AriaProperties Property:

  • readonly
More in this category: « aria-posinset aria-relevant »