Definition and usage
The <label> tag defines the callout (tag) for the INPUT element.
The label element does not present any special effects to the user. However, it improves usability for the user of the mouse. This control is triggered if you tap text inside a LABEL element. That is, when the user selects the label, the browser automatically shifts the focus to the label-related form controls.
The For property of the <label> tag should be the same as the id attribute of the related element.
--------------------------------------------------------------------------------------------------------------- ------------------
I didn't know what I was talking about at the finish.
Finally, here's the question of the accessibility of label tags in HTML5 see examples to understand: is to make the user in the choice of time easier, click on the text of the selection box can be checked on the selected option.
In HTML5, you can use the label label in 3 ways:
associating controls with for and IDs
<p><label for= "Test" > Label </label> <input name= "input" type= "text" id= "test"/></p>
Label Label Wrapping Control
<p><label> label <input name= "Input" type= "text"/></label></p>
- pronged approach
<p><label for= "test2" > Label <input name= "Input" type= "text" id= "Test2"/></label></p>
However, the accessibility of the format using the For + ID is better than the form of inclusion, so in everyday use it is best to use the For + ID form.
The role of label