HTML <label> tag

Updated: 11/13/2018 by Computer Hope
HTML label tag

When writing in HTML, the <label> tag is used to create labels for items in a user interface. Used within <input> tags on a form, the <label> tag is additionally useful because it extends the clickable area of control elements, like buttons. The following sections contain information about the <label> tag, including an example of it in use, and related attributes and browser compatibility.


The <label> tag belongs to a group of tags called form elements.

Example of <label> code

<h3>Which type of pet do you prefer?</h3>
<label for="dogs">Dogs</label>
<input type="radio" name="animal" id="dogs" value="dogs"><br><br>
<label for="cats">Cats</label>
<input type="radio" name="animal" id="cats" value="cats"><br><br>
<input type="submit" value="Submit">

Example result

Which type of pet do you prefer?


Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The following table shows all of the current unique HTML attributes for the <label> tag, and a description of each.

Attribute Description
for Designates which form element a label is describing.
form Designates the form where a label belongs.


Edge Internet Explorer Firefox Safari Opera Chrome
All versions All versions All versions All version All versions All versions

Additional form elements

Browser, Compatibility, Form, User interface, Web design terms, Web page