The <label> tag in HTML is used to provide a usability improvement for mouse users i.e, if a users clicks on the text within the <label> element, it toggles the control. The <label> tag defines the label for <button>, <input>, <meter>, <output>, <progress>, <select>, or <textarea> element.
<label> form content... </label>
The <label> tag can be used in two ways:
- Firstly, use <label> tag by providing the <input> and id attribute. The <label> tag needs a for attribute whose value is same as input id.
- Alternatively, <input> tag use directly inside the <label> tag. In this case the for and id attributes are not needed because the association is implicit.
Attribute Value: This tag contains two attribute for and form.
Supported Browsers: The browser supported by label tag are listed below:
- Google Chrome
- Internet Explorer
- What purpose does a <script> tag serve inside of a <noscript> tag?
- Difference between <article> tag and <section> tag
- Why <big> tag is not in HTML5 while <small> tag exists ?
- HTML | DOM Label Object
- HTML | aria-label attribute
- HTML | DOM Option label Property
- HTML | DOM Label htmlFor Property
- How to create an HTML checkbox with a clickable label?
- HTML | DOM Track label property
- HTML <label> for Attribute
- HTML | <label> form Attribute
- HTML | label Attribute
- HTML | <track> label Attribute
- HTML | <option> label Attribute
- HTML | DOM OptionGroup label Property
- HTML | <optgroup> label Attribute
- HTML | DOM Label form Property
- HTML | <html> Tag
- How to put an input element on the same line as its label?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.