HTML

(*-*)浩
(*-*)浩Original
2019-09-27 15:51:033231browse

HTML 2e1cf0710519d5598b1f0f14c36ba674 tag

HTML <label> tag

##All major browsers support the 2e1cf0710519d5598b1f0f14c36ba674 tag.

Safari 2 or earlier does not support the 2e1cf0710519d5598b1f0f14c36ba674 label.

Definition and usage (Recommended learning: HTML introductory tutorial)

2e1cf0710519d5598b1f0f14c36ba674 The label defines the label for the input element (mark ). The

label element does not present any special effects to the user. However, it improves usability for mouse users. This control is triggered if you click on the text inside the label element. That is to say, when the user selects the label, the browser will automatically turn the focus to the form control related to the label.

2e1cf0710519d5598b1f0f14c36ba674 The for attribute of the label should be the same as the id attribute of the related element.

Tips

Note: The "for" attribute can bind the label to another element. Please set the value of the "for" attribute to the value of the id attribute of the relevant element.

Example

Simple HTML form with two input fields and associated tags:

<html>
<body>

<p>请点击文本标记之一,就可以触发相关控件:</p>

<form>
<label for="male">Male</label>
<input type="radio" name="sex" id="male" />
<br />
<label for="female">Female</label>
<input type="radio" name="sex" id="female" />
</form>

</body>
</html>

The above is the detailed content of HTML

Statement:
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
Previous article:HTML
tagNext article:HTML
tag