Skip to content

A JQuery plugin to increase accessibility of form elements for keyboard users

License

Notifications You must be signed in to change notification settings

67Bricks/jquery.labelFocus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jquery.labelFocus

A JQuery plugin to increase accessibility of form elements for keyboard users

labelFocus is a JQuery plugin to enable highlighting of the labels of form fields when those form fields are focussed. It is intended to increase the accessibility of form elements - particularly checkboxes and radio buttons - when accessed by the keyboard. The problem it aims to overcome is that most browsers make it very hard to see when a checkbox or radio button has the focus.

The plugin works by adding the “focus” CSS class (or other class specified by the focusClass option) to the label of a form field, when that form field receives focus.

When used on a form element within a table, it will also apply the same CSS class to any “th” elements that appear to be appropriate for the current item - this is not very sophisticated, and may well fail or highlight the wrong header if used on a table with colspans or rowspans. This behaviour can be disabled by setting the highlightTables option to false.

Typical usage:

$(document).ready(function() {
  $('input[type=checkbox],input[type=radio]').labelFocus();
});

This plugin requires JQuery 1.3+ (it was developed under JQuery 1.3.2).

About

A JQuery plugin to increase accessibility of form elements for keyboard users

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published