dijit/_base/wai (version 1.10)

Summary

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.

Method Summary

  • getWaiRole(elem) Gets the role for an element (which should be a wai role).
  • getWaiState(elem,state) Gets the value of a state on an element.
  • hasWaiRole(elem,role) Determines if an element has a particular role.
  • hasWaiState(elem,state) Determines if an element has a given state.
  • removeWaiRole(elem,role) Removes the specified role from an element.
  • removeWaiState(elem,state) Removes a state from an element.
  • setWaiRole(elem,role) Sets the role on an element.
  • setWaiState(elem,state,value) Sets a state on an element.

Methods

getWaiRole(elem)
Defined by dijit/_base/wai

Gets the role for an element (which should be a wai role).

Parameter Type Description
elem Element
Returns:any | undefined

The role of elem or an empty string if elem does not have a role.

getWaiState(elem,state)
Defined by dijit/_base/wai

Gets the value of a state on an element.

Checks for an attribute called "aria-"+state.

Parameter Type Description
elem Element
state String
Returns:any | string

The value of the requested state on elem or an empty string if elem has no value for state.

hasWaiRole(elem,role)
Defined by dijit/_base/wai

Determines if an element has a particular role.

Parameter Type Description
elem Element
role String
Optional
Returns:any | boolean

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

hasWaiState(elem,state)
Defined by dijit/_base/wai

Determines if an element has a given state.

Checks for an attribute called "aria-"+state.

Parameter Type Description
elem Element
state String
Returns:any | boolean

true if elem has a value for the given state and false if it does not.

removeWaiRole(elem,role)
Defined by dijit/_base/wai

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
removeWaiState(elem,state)
Defined by dijit/_base/wai

Removes a state from an element.

Sets an attribute called "aria-"+state.

Parameter Type Description
elem Element
state String
setWaiRole(elem,role)
Defined by dijit/_base/wai

Sets the role on an element.

Replace existing role attribute with new role.

Parameter Type Description
elem Element
role String
setWaiState(elem,state,value)
Defined by dijit/_base/wai

Sets a state on an element.

Sets an attribute called "aria-"+state.

Parameter Type Description
elem Element
state String
value String
Error in the documentation? Can’t find what you are looking for? Let us know!