← All Exercises
Group Radio Buttons with Fieldset and Legend
basichtml
Background
Radio buttons without a programmatic group name force screen reader users to guess what the options belong to.
Problem
Create a shipping-speed radio group where a fieldset legend names the group, every input has a label, all radios share one name, and a hint explains delivery estimates.
Input
Three shipping options with prices and one delivery hint.
Output
A fieldset with a legend, labelled radios, and a described-by hint.
Sample tests
Sample 1
Input: Screen reader enters the radio group
Expected: fieldset legend announces Shipping speed and aria-describedby points to the hint paragraph
Sample 2
Input: Keyboard user tabs through the form
Expected: the checked radio is one Tab stop and arrow keys move selection inside the group
Your solution
Learning objective
Use fieldset, legend, and shared radio names to expose a correctly grouped and keyboard-operable choice control.