label tag in form

The label label in the form

My friends, when you were studying the various controls of the form, did you find a label-label? The following section will reveal its function. The

label label does not present any special effects to the user; its purpose is to improve usability for mouse users. This control will be triggered if you click on the text inside the label. That is to say, when the user clicks to select the label, the browser will automatically turn the focus to the form control related to the label (it will automatically select the form control related to the label).

Syntax:

<label for="控件id名称">

Note: The value in the for attribute of the tag should be the same as the id attribute value of the related control It must be the same.

Example:

<form>
  <label for="male">男</label>
  <input type="radio" name="gender" id="male" />
  <br />
  <label for="female">女</label>
  <input type="radio" name="gender" id="female" />
  <label for="email">输入你的邮箱地址</label>
  <input type="email" id="email" placeholder="Enter email">
</form>
Continuing Learning
||
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>form中的lable标签</title> </head> <body> <form><h1>我的第一个网页</h1> 你的性别?<br> <label for="male">男</label> <input type="radio" name="sex" id="male" /> <label for="female">女</label> <input type="radio" name="sex" id="female" /> <br /> 你对什么运动感兴趣?<br> <input type="checkbox" name"checkbox1" value="跑步">跑步 <input type="checkbox" name"checkbox2" value="打球" checked="checked">打球 <input type="checkbox" name"checkbox3" value="登山" checked="checked">登山 <input type="checkbox" name"checkbox4" value="健身">健身<br> <label for="email">输入你的邮箱地址</label> <input type="email" id="email" placeholder="Enter email"> <input type="reset" value="重置"> </form> <img src ="http://e.hiphotos.baidu.com/image/w%3D400/sign=0648f314abd3fd1f3609a33a004f25ce/80cb39dbb6fd526654d55c2ea818972bd4073609.jpg"> </body> </html>
submitReset Code