freeCodeCamp/guide/chinese/certifications/responsive-web-design/basic-html-and-html5/check-radio-buttons-and-che.../index.md

11 lines
710 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
title: Check Radio Buttons and Checkboxes by Default
localeTitle: 默认情况下检查单选按钮和复选框
---
## 默认情况下检查单选按钮和复选框
`checked`属性,只能与`type="radio"`和`type="checkbox"` ,是一个布尔属性(你可以在这个链接上检查有关`required`属性的挑战,布尔也是如此: [使用html5来要求一个字段](https://learn.freecodecamp.org/responsive-web-design/basic-html-and-html5/use-html5-to-require-a-field/) )。
作为布尔属性,您只需将`checked`的单词添加到默认情况下要设置的`input` HTML元素挑战要求您默认设置代码中已存在_的第一个_复选框和单选按钮
祝你好运!