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

11 lines
716 B
Markdown

---
title: Check Radio Buttons and Checkboxes by Default
---
## Check Radio Buttons and Checkboxes by Default
The `checked` attribute, exclusively usable with `type="radio"` and the `type="checkbox"`, is a boolean attribute ( you can check the challenge about the `required` attribute, boolean aswell, at this link: [use html5 to require a field](https://learn.freecodecamp.org/responsive-web-design/basic-html-and-html5/use-html5-to-require-a-field/)).
As boolean attribute you simply have to add the word `checked` to the `input` HTML element you want to set checked by default (the challenge requires you to set by default _the first_ of the checkbox and radio-buttons already present in the code).
Good luck!