Home > Common Problem > What is the function of label label?

What is the function of label label?

coldplay.xixi
Release: 2023-02-09 14:21:24
Original
39165 people have browsed it

The label label improves usability for mouse users. When the user clicks on the text in the [

What is the function of label label?

The operating environment of this article: windows10 system, html5, thinkpad t480 computer.

The function of the label label:

1.

In html, < The ;label> tag is usually used together with the tag, which defines a label (marker) for the input element.

The purpose of the

2.

<label for="关联控件的id" form="所属表单id列表">文本内容</label>
Copy after login

Description:

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

There is also a new attribute form in HTML5. The form attribute is used to specify the id list of one or more forms to which it belongs, separated by spaces;

When the

, you need to use the form attribute to specify the form to which it belongs;

3. Example

<!DOCTYPE html><html><head><meta charset="utf-8" /><title>html中label标签的详细介绍</title></head><body bgcolor="bisque"><form action="" id="form1"><input type="checkbox" id="basketball"><label for="basketball">篮球</label><input type="checkbox" id="football"><label for="football">足球</label><input type="checkbox" id="tableTennis"><label for="tableTennis">乒乓球</label><br><input type="submit" value="提交"/></form><label for="football" form="form1">足球</label></body></html>
Copy after login

Running results :

What is the function of label label?

Related free learning recommendations: php programming (video)

The above is the detailed content of What is the function of label label?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template