Forms

label

Creates a text label for an input element. Clicking on the label text should toggle the related input element. To associate a label the “for” attribute is used, setting the id of the related element as its value. Inline element

Syntax

<label attributes> ... </label>

Example

<label for=”name”>Enter your name</label> 
<input id=”name” name=”name” type=”text” />

Related tags

CSS Properties

HTML attributes

Search the Soup!