Labels

The primary distinction between an accessible form and a non-accessible one is the use of the <label> tag for prompts.


<label for="name">Your name</label><input type="text" size="30" id="name" />


Labels allow screen readers to programmatically associate the prompt text (eg "Your name") with the appropriate input.

When a screen reader accesses a form item that has a <label> element associated with it, it will read the text within the <label> element and indicate the type of form item it is (e.g., "Name. Text box." or "Age. Check box").