A shipping choice uses fieldset, legend, shared radio names, and a checked default so related controls read as one group.

Program

fieldset and legend create a named group for controls that answer one question. Radio buttons join the group when they share the same name.

fieldset_radio_group.html
Visuals: captured from real browser rendering
<fieldset>
  <legend>Shipping speed</legend>
  <label><input type="radio" name="speed" value="standard" checked> Standard</label>
  <label><input type="radio" name="speed" value="express"> Express</label>
</fieldset>
  1. Create a form control group.

    The browser draws a named area around related controls.
    The browser draws a named area around related controls.
  2. Name the group.

    The legend gives the whole radio group a visible label.
    The legend gives the whole radio group a visible label.
  3. Connect the first radio to the group.

    The shared name makes this control part of the same choice set.
    The shared name makes this control part of the same choice set.
  4. Choose a default option.

    checked makes Standard selected before the user changes anything.
    checked makes Standard selected before the user changes anything.
  5. Add an alternate value.

    The second radio is mutually exclusive with the default.
    The second radio is mutually exclusive with the default.
fieldset fieldset groups related form controls.
legend legend names the grouped controls for people and assistive technology.
radio name Radio inputs with the same name form one exclusive choice group.