The best HTML <label> tag Tutorial In 2024, In this tutorial you can learn Examples,Browser Support,Tag definitions and instructions,Tips and Notes,Differences between HTML 4.01 and HTML5,Attributes,Global Properties,Event Properties,
With two input fields and related marks simple HTML form:
Most browsers support <label> tag.
<Label> tag for the input element defines the label (tag).
label elements do not exhibit any special effects to the user. However, it is for the mouse users to improve usability. If you click on the text within the label element, it will trigger this control. That is, when the user selects the tab, the browser will automatically focus to the associated form controls and labels.
<Label> tag attributes should be the same for the id attribute related elements.
Tip: "for" property of the label bound to another element.Please set the value "for" property to the value of the id attribute of the related elements.
"Form" attribute of HTML5 is the new property.
New: HTML5 new property.
属性 | 值 | 描述 |
---|---|---|
for | element_id | 规定 label 与哪个表单元素绑定。 |
form New | form_id | 规定 label 字段所属的一个或多个表单。 |
<label> tag supports the global attributes, view complete the property sheet HTML Global Attributes .
<label> tag supports all HTML event attributes .