English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
: <progress> tag
Online Example
Example !doctype html> <html> <head>-8<meta charset="UTF ">5 <title>HTML3Label tag usage (Basic Tutorial Website w/codebox.com)</title> </title> head> <body>1<h/>label usage<1h >-<form action="demo form.php">/<label for="address">Address: < <label for="company">Company: < <input type="text" name="company" id="company"><br>/<label for="address">Address: < label> <input type="text" name="address" id="address"><br> </<input type="submit" value="Submit"> </body> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
Most web browsers currently support the <label> tag.
The <label> tag defines a label (mark) for the input element. It is used to display the title of an interactive control on a webpage.
The label element does not present any special effect to the user. However, it improves accessibility for mouse users. If you click on the text within a label element, it will trigger this control. That is to say, when the user selects the label, the browser will automatically focus on the form control related to the label.
The for attribute of the <label> tag should be the same as the id attribute of the related element.
Hint:"for" attribute can bind the label to another element. Set the value of the "for" attribute to the value of the id attribute of the related element.
"form" attribute is the difference between HTML5 new attributes.
New: HTML5 New attribute.
Attribute | Value | Description |
---|---|---|
for | element_id | Specifies which form element the label is bound to. |
formHTML5 | form_id | Specifies one or more forms to which the label field belongs. |
<label> tag supports global attributes, see the complete attribute table HTML global attributes.
<label> tag supports all HTML event attributes.