Button Examples (IDL Version)
- -About This example
-The following examples of the Button Pattern demonstrate a new JavaScript syntax for coding ARIA attributes.
-
- The JavaScript for the example buttons on this page uses the IDL Interface defined in ARIA 1.2.
- The purpose of these examples is to illustrate how to use ARIA Attribute Reflection and provide a test case for browser and assistive technology interoperability.
- Specifically, the role and ariaPressed attributes are accessed using dot notation instead of setAttribute() and getAttribute().
- In all other respects, these examples are identical to the Button Examples.
-
Example
-Important
@@ -85,131 +47,5 @@Keyboard Support
- -| Key | -Function | -
|---|---|
| Enter | -Activates the button. | -
| Space | -Activates the button. | -
Role, Property, State, and Tabindex Attributes
- -| Role | -Attribute | -Element | -Usage | -
|---|---|---|---|
button |
- - | div, a |
-
-
|
-
| - |
- tabindex="0"
- |
- div, a |
-
-
|
-
| - | aria-pressed="false" |
- a |
-
-
|
-
| - | aria-pressed="true" |
- a |
-
-
|
-
| - | aria-hidden="true" |
- svg |
- Excludes SVG from accessible name calculation for the button. | -
JavaScript and CSS Source Code
- --
-
- - CSS: - button.css - -
- - JavaScript: - button_idl.js - -
HTML Source Code
-To copy the following HTML code, please open it in CodePen.
- -
-
-
-