HTML: input type="radio"

Radio inputs let a user choose one option from a group of mutually exclusive choices.

What you will learn

Minimal example

<fieldset>
  <legend>Delivery speed</legend>
  <label><input type="radio" name="speed" value="standard" checked> Standard</label>
  <label><input type="radio" name="speed" value="express"> Express</label>
</fieldset>

Radio inputs with the same name belong to one group. Give each choice a distinct value, and use fieldset and legend when the group needs a shared question.

Common mistakes