Labels and Keyboard Shortcuts
- Home
- HTML
- Labels and Keyboard Shortcuts
Two new attributes introduced in
HTML 4.0 were LABEL and ACCESSKEY. They are used to improve usability and accessibility by associating a keyboard shortcut or a label with the element. When the users clicks on the LABEL, the click event is passed on to the associated element. ACCESSKEY can be used either directly on an element or in conjunction with a LABEL.
The examples below illustrate this further.
Example 1: Associating a label with a checkbox
In this example, clicking the text "Check to receive
mailing" will toggle the checkbox.
Keyboard Shortcuts HTML HTML 4.0 Accesskey Label html accesskey keyboard shorcuts