Deprecated methods for setting/getting wai roles and states. New code should call setAttribute()/getAttribute() directly.
Also loads hccss to apply dj_a11y class to root node if machine is in high-contrast mode.
See the dijit/_base/wai reference documentation for more information.
Gets the role for an element (which should be a wai role).
Parameter | Type | Description |
---|---|---|
elem | Element |
The role of elem or an empty string if elem does not have a role.
Gets the value of a state on an element.
Checks for an attribute called "aria-"+state.
Parameter | Type | Description |
---|---|---|
elem | Element | |
state | String |
The value of the requested state on elem or an empty string if elem has no value for state.
Determines if an element has a particular role.
Parameter | Type | Description |
---|---|---|
elem | Element | |
role | String |
Optional
|
True if elem has the specific role attribute and false if not. For backwards compatibility if role parameter not provided, returns true if has a role
Determines if an element has a given state.
Checks for an attribute called "aria-"+state.
Parameter | Type | Description |
---|---|---|
elem | Element | |
state | String |
true if elem has a value for the given state and false if it does not.
Removes the specified role from an element. Removes role attribute if no specific role provided (for backwards compat.)
Parameter | Type | Description |
---|---|---|
elem | Element | |
role | String |
Removes a state from an element.
Sets an attribute called "aria-"+state.
Parameter | Type | Description |
---|---|---|
elem | Element | |
state | String |
Sets the role on an element.
Replace existing role attribute with new role.
Parameter | Type | Description |
---|---|---|
elem | Element | |
role | String |
Sets a state on an element.
Sets an attribute called "aria-"+state.
Parameter | Type | Description |
---|---|---|
elem | Element | |
state | String | |
value | String |