References

Collection of references for web development.

HTML label tag

Description

The HTML <label> element represents a label to add to form controls, for example this could be used to describe an input box.

Attributes

Attribute Value Description
for ID Specifies the ID of the element that the label element is related to.

Example

<form>
	<label for="age">Your Age?</label>
	<input type="text" id="age" name="age">
</form>

Example #2

<form>
	<label for="rememberme">Remember Me?</label>
	<input type="checkbox" id="rememberme">
</form>

More Examples