<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>form中的lable标签</title>
</head>
<body>
<form>
你对什么运动感兴趣? <br />
<label for="sport">慢跑</label>
<input type="checkbox" name="慢跑" id="sport" />
<br />
<label for="sport">登山</label>
<input type="checkbox" name="登山" id="sport" />
<br />
<label for="sport">篮球</label>
<input type="checkbox" id="sport" name="篮球">
</form>
</body>
</html>
id唯一标识,id名字在每个页面中只能允许出现一次,name建议使用英文
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>form中的lable标签</title>
</head>
<body>
<form>
你对什么运动感兴趣?
<br />
<label for="run">慢跑</label>
<input type="checkbox" name="run" id="run" />
<br />
<label for="mountain">登山</label>
<input type="checkbox" name="mountain" id="mountain" />
<br />
<label for="basketball">篮球</label>
<input type="checkbox" id="basketball" name="basketball">
</form>
</body>
</html>
据我所知,id是唯一的,class名字是相同的,id不能一样,你再改改