Accessibility Library

Form Labels

Label element to associate text with form elements explicitly.

Attributes

Name Description
for Attribute associates the label with a control element

Live Example


Code sample

<label for="firstname">First name:</label>
<input type="text" name="firstname" id="firstname">
<input type="checkbox" name="subscribe" id="subscribe">
<label for="subscribe">Subscribe to newsletter</label>