請大佬們幫忙看看
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>form中的lable標簽</title>
</head>
<body>
<form>
? ? <lable for="興趣調(diào)查">你對什么運動感興趣:</lable>
? ? <br><br>
? ? <lable for="jog">跑步</lable>
? ? <input type="checked" name="checkbox1" value="慢跑" id="jog" /><br>
? ? <lable for="climb">登山</lable>
? ? <input type="checked" name="checkbox2" value="登山" id="climb" /><br>
? ? <lable for="basketball">籃球</lable>
? ? <input type="checked" name="checkbox3" value="籃球" id="basketball" />
</form>
</body>
</html>
請問各位大佬,我想寫一個復選框的這個結(jié)果出來的情況是這樣的,看了答案不該寫value進去,但是之前有一張教復選框的寫了這個進去呀
2019-07-29
注意區(qū)分 input type="checkbox" 和 checked="checked"
2019-05-29
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>form中的lable標簽</title>
</head>
<body>
<form>
??? <lable for="興趣調(diào)查">你對什么運動感興趣:</lable>
??? <br />
?? <label for="jog">慢跑</label>
? <input type="radio" name="sport" id="jog" />
? <br />
? <label for="climb">登山</label>
? <input type="radio" name="sport" id="climb" />
? <br />
? <label for="basketball">籃球</label>
? <input type="radio" name="sport" id="basketball" />
?
</form>
</body>
</html>
2019-05-25
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>form中的lable標簽</title>
</head>
<body>
<form>
? ? <lable for="興趣調(diào)查">你對什么運動感興趣:</lable>
? ? <br><br>
? ? <lable for="jog">跑步</lable>
? ? <input type="checkbox" name="checkbox1" value="慢跑" id="jog" /><br>
? ? <lable for="climb">登山</lable>
? ? <input type="checkbox" name="checkbox2" value="登山" id="climb" /><br>
? ? <lable for="basketball">籃球</lable>
? ? <input type="checkbox" name="checkbox3" value="籃球" id="basketball" />
</form>
</body>
</html>
解釋:
復選框的標準格式:<input type="checkbox" value="" name="" id="">
checkbox是input標簽里的一個type(類型):復選框
checked是input標簽里的一個屬性:默認選中
【小慶弟_斯文回答】
2019-05-24