Label tags in HTML

Label tags will ensure that screen readers match the right label to the right input box in all your forms.

Here's the bare-bones HTML for the form segment above. It looks OK, but is susceptible to misinterpretation by screen reader/=.

<form method="post"> Your hometown
<input type="text" name="hometown"> </form>

Here's the same code with the label tag info added in.

<form method="post"
<label for ="town">Your hometown</label>
<input type="text" name="hometown" id="town">

Because the "label for" (town) matches the input "id" (town), the screen reader gets it right, announcing "Your hometown" when the user clicks on the blank.