...
Keyboard A11y API
Code Block |
---|
jQuery().tabindex()
|
Gets the tabindex value of the first matched element. If the element doesn't have a tabindex attribute, undefined is returned. The value returned is normalized to a Number, since browser implementations vary.
Code Block |
---|
jQuery().tabindex(value)
|
Sets the tabindex value on all matched elements. value can be either a String or a Number, but valid tabindex attributes need to be integers.
Code Block |
---|
jQuery().removeTabindex()
|
Removes the tabindex attribute from all matched elements.
Code Block |
---|
jQuery().hasTabindexAttr()
|
Returns true if the element has a tabindex attribute, and returns false if tabindex is not set. Neither Simon or I have yet to come up with a reliable method for querying tabindex attributes on versions of IE < 6, so this method will always return false on IE 5.5 and below.
Code Block |
---|
jQuery().hasTabindex()
|
Returns true if the element has a tabindex attribute, or is an HTML element that is included in the tab order by default (i.e. a, input, button, select, area, textarea, or object).
Code Block |
---|
jQuery().tabbable()
|
Adds all matched elements to the tab order by giving them a tabindex attribute of "0."
Code Block |
---|
jQuery().selectable(container, customHandlers, options)
|
Makes all matched elements selectable with the arrow keys. Provide your own customHandlers to inject custom styling and logic. Options lets you modify the plugin's default selection behaviour.
Code Block |
---|
jQuery().activatable(customHandlers, options)
|
Makes all matched elements activatable with the Spacebar and Enter keys. Provide your own handlers to trigger custom behaviour. Options allow you to activate elements using other keystrokes.
Code Block |
---|
jQuery ().selectNext ();
jQuery ().selectPrevious ();
jQuery ().select (elementToSelect);
|
Selects the next, previous, or specified element in the list of selectables.
Code Block |
---|
jQuery ().currentSelection ();
|
Gets the currently selected element.
Code Block |
---|
jQuery ().activate (elementToActivate);
|
Activates the specified item using the default activation handlerThe API can be found on the jQuery Keyboard Accessibility Plugin page.