The HTML5 label Tag
The main purpose of the HTML5 <label> tag is to provide a name for the <input> element. It is not something that would provide benefits for the author of the HTML document. However, the HTML5 <label> tag is important for the users of the web page. When the user scrolls the mouse over the HTML5 <label> tag, the control is toggled.
The HTML5 <label> tag is new and it is not present in HTML4.01 so there could not be any comparison made. It is because the HTML5 <form> tag which the HTML5 <label> tag is primarily used for is also not present in HTML4.01.
Using the HTML5 <label> tag is not difficult for the author since it is possible to use it harmoniously along with the Event Attributes and Global Attributes in HTML5. The HTML5 <label> tag is also interpreted properly by the major web browsers like Internet Explorer, Safari, Opera, Google Chrome and Firefox.
The attributes for HTML5 <label> tag are the following:
Attribute |
Value |
Description |
For |
element_id |
It is necessary in determining the form element that a label is associated to |
form (New) |
form_id |
It is utilized in pointing out one or more forms that the label is incorporated in |