aria-selected attribute | ariaSelected property
Sets or retrieves the selection state of this element.
![]() |
Syntax
| HTML |
|---|
<element aria-selected="p" ... > |
| JavaScript |
|---|
object.setAttribute("aria-selected",value);var value = object.getAttribute("aria-selected");
|
Property values
Type: String
The selection state.
Standards information
- Accessible Rich Internet Applications (WAI-ARIA) 1.0, Section 6.6
Remarks
| Used in Roles |
|
|---|
Selecting an element indicates that it is chosen for an action, and most likely has focus.
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). See also
Show:
