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

 

Featured pages

Overview

Learn about HTML5 architecture, design principles and patterns on HTML5 Overview Tutorial. Become …

Tags

Learn about HTML5 tags and discover a new list of HTML5 tags. Find out about HTML5 tags support by…

Welcome

 Learn HTML5 development techniques, tips and tricks on our website. Find out what is required…

Date Time Picker

HTML5 forms use date and time controls regularly. HTML5 date and time controls are used by booking …