Skip navigation

Use the <LABEL> tag in HTML 4 to connect the form element and its label.

(see guidelines for overcoming access barriers)

The <LABEL> tag is read by assistive technologies and is expressed when the user highlights the labelled form element. This is particularly important as a form becomes more detailed and complicated.

The Access key in this example (and throughout this site) will focus the users cursor directly on a particular form element when they press alt and whatever character is underlined in the text.

Example:

Connecting the form label with its element:

Code for connecting the form label with its element


<form name="details">
   <p><label for="firstname" accesskey="n">
   First <u>n</u>ame:</label>
   <input type="text" id="firstname" name="fname" tabindex="1"></p>
</form>

Back to top