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.
There are two ways to use it:
Method 1 uses the For property
<for= "UserName"> user name:</label>< type = "text" id = "UserName"/>
Method 2
< label > Username:<type= "text"/></label>
When using the radio button radio or the Multi-select button checkbox, it is sometimes necessary to select a single or multiple selection button when the text is selected, which can also be used similar to the above method.
Method 1
< label >< type= "Radio"/> user name </label>< label><type= "checkbox"> School </ label >
Method 2 uses the For property
<label for= "UserName">User name</label> <inputtype= "Radio"ID= "UserName" /><label for= "UserName">User name</label> <inputtype= "checkbox"ID= "UserName" />
The For property of the HTML label label