SyntaxStudy
Sign Up

<label>

tag

Represents a caption for an item in the user interface. Clicking a label focuses its associated input.

Syntax

<label for="inputId">Label text</label>

Example

html
<!-- Using for/id -->
<label for="username">Username:</label>
<input type="text" id="username" name="username">

<!-- Wrapping the input -->
<label>
    <input type="checkbox" name="subscribe"> Subscribe to newsletter
</label>