Home >Web Front-end >HTML Tutorial >HTML
HTML 2e1cf0710519d5598b1f0f14c36ba674 tag
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