Skip to main content

HTML Guide

The value of the “for” attribute of the “label” element must be the ID of a non-hidden form control.

<label> tags are used to label inputs in form, which need to be present and visible in the document, for example:

<label for="age">Age</label>
<input id="age" />

Related W3C validator issues