Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What's the use of label tags?

Shulou Source: shulou.com Published: 2022-06-02 18:25:48 10月04日 Update

Xiaobian to share with you what is the use of label label, I hope you read this article after the harvest, let us discuss it together!

The label tag improves usability for mouse users. When the user clicks on the text in the label, the browser automatically shifts focus to the control associated with the label.

The role of label:

I. Label definition and usage

In html, tags are often used in conjunction with tags, which define annotations (tags) for input elements.

Tags improve usability for mouse users. When a user clicks on text in a tag, the browser automatically shifts focus to the control associated with the tag.

Labels are often used on radio buttons and check buttons, and when you use this label, the text of the radio button or check button can also be selected.

II. Label syntax format

text content

Description:

The id of the associated control generally refers to the id of the input element;

HTML5 also adds a form attribute, which specifies a list of id's of one or more forms, separated by spaces;

When the label is not in the form label, you need to use the form attribute to specify the form to which it belongs;

III. Examples

html label Details Basketball Football Table Tennis

football

Run Results:

After reading this article, I believe you have a certain understanding of what label labels are used for. If you want to know more about related knowledge, welcome to pay attention to the industry information channel. Thank you for reading!

Tags: Tags buttons text users roles attributes controls forms associations elements usability ownership browser focus articles football mouse browsing table tennis content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei MySQL OPPO Reno Apple NVidia