定义和用法
for 属性规定 label 绑定的表单元素。
语法
<label for="element_id">
实现
<form method="post" action="study-result.html">
<p>单选 性别:<br>
<input type="radio" id="man" name="sex" checked>
<label for='man'>男</label>
<br>
<input type="radio" id="woman" name="sex"/>
<label for='woman'>女</label>
<br>
</p>
<p>多选 爱好:<br>
<input type="checkbox" id="sleep" name="hobby" checked/>
<label for='sleep'>睡觉</label><br>
<input type="checkbox" id="game" name="hobby"/>
<label for='game'>游戏</label><br>
<input type="checkbox" id="run" name="hobby"/>
<label for='run'>跑步</label><br>
</p>
<p>
<input type="submit" name="button1" value="提交">
<input type="reset" name="button2" value="重填">
</p>
</form>