label element

The HTML element that names a form control; its for attribute (htmlFor in React) holds the control's id.

In more detail

A linked label gives the control its accessible name and makes clicking the label focus the control. React uses htmlFor because for is a reserved word in JavaScript.

Example

<label htmlFor={inId}>Email</label><input id={inId} />

Related terms

Taught in

References