<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<form name="form1">
<div>
<label for="username">姓名</label>
<input id="username" value="zyz">
</div>
<div>
<label >密码</label>
<input name="password" value="123">
</div>
<div>
<input type="radio" name="radio1" >
<input type="radio" name="radio1">
<input type="radio" name="radio1">
</div>
<div>
<input type="checkbox" name="checkbox1" value="c1">
<input type="checkbox" name="checkbox1" value="c2" checked>
<input type="checkbox" name="checkbox1" value="c3">
</div>
<button id="btn">按钮</button>
</form>
<script>
const checkbox = document.form1.checkbox1
for(let i=0; i < checkbox.length; i++){
console.log(checkbox[i].checked)
}
</script>
</body>
</html>