Challenge - 5 Problems
Radio and Checkbox Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Understanding radio button grouping
What happens when multiple radio buttons share the same
name attribute in an HTML form?Attempts:
2 left
💡 Hint
Think about how radio buttons are designed to let users pick one option from many.
✗ Incorrect
Radio buttons with the same name attribute form a group where only one option can be selected at a time. Selecting another option deselects the previous one.
📝 Syntax
intermediate1:30remaining
Correct checkbox syntax
Which option shows the correct HTML syntax for a checkbox input with label 'Subscribe'?
Attempts:
2 left
💡 Hint
Remember the correct input type and how labels link to inputs.
✗ Incorrect
The correct way is to use <input type="checkbox"> and a <label> with a matching for attribute to the input's id.
❓ rendering
advanced2:00remaining
Visual result of grouped radio buttons
What will the user see when this HTML code is rendered in a browser?
<form> <input type="radio" name="color" id="red" value="red"> <label for="red">Red</label> <input type="radio" name="color" id="blue" value="blue"> <label for="blue">Blue</label> </form>
Attempts:
2 left
💡 Hint
Look at the input types and the shared name attribute.
✗ Incorrect
The code creates two radio buttons with the same name, so the user can select only one color at a time.
❓ accessibility
advanced2:00remaining
Improving checkbox accessibility
Which option best improves accessibility for a checkbox input labeled 'Accept Terms'?
Attempts:
2 left
💡 Hint
Consider how screen readers associate labels with inputs.
✗ Incorrect
The best practice is to use <label> with a matching for attribute to the input's id. This ensures screen readers correctly announce the label and makes the label text clickable for better usability.
❓ selector
expert2:00remaining
CSS selector for checked checkboxes
Which CSS selector correctly styles only the checkboxes that are checked?
Attempts:
2 left
💡 Hint
Look for the correct pseudo-class syntax for checked inputs.
✗ Incorrect
The :checked pseudo-class selects checked checkboxes. The syntax must be input[type="checkbox"]:checked.