HTML & CSS · Junior · Question 57 of 75
How should a group of related radio buttons be marked up?
<fieldset>
<legend>Delivery</legend>
<label><input type="radio" name="delivery" value="courier" /> Courier</label>
<label><input type="radio" name="delivery" value="pickup" /> Pickup</label>
</fieldset>- ✓Correct answer: Wrap them in
<fieldset>with a<legend>and give them the samename - 2Give each radio a unique
name - 3Put them in a
<div>with a heading
Explanation
The shared name makes them mutually exclusive. <legend> is announced as the group's label, so the user knows what "Courier" refers to.