HTML <input type=”radio”> (original) (raw)
Last Updated : 23 May, 2026
The element in HTML is used to create radio buttons for selecting one option from multiple choices. Only one radio button in the same group can be selected at a time.
- Used to select a single option from a group of choices.
- Radio buttons are grouped using the same name attribute.
- Commonly used in forms, surveys, and selection menus.
**Syntax:
**Note: The value attribute gives each radio button a unique identifier, helping identify the selected option upon form submission.
**Example 1: The HTML creates a set of radio buttons for selecting a technology brand. Only one option can be selected at a time, with "Microsoft" pre-selected using the checked attribute.
HTML `
Select a Technology Brand:
<div>
<input type="radio"
id="Netflix"
name="brand"
value="Netflix">
<label for="Netflix">Netflix</label>
</div>
<div>
<input type="radio"
id="Audi"
name="brand"
value="Audi">
<label for="Audi">Audi</label>
</div>
<div>
<input type="radio"
id="Microsoft"
name="brand"
value="Microsoft" checked>
<label for="Microsoft">Microsoft</label>
</div>
`
**Example 2: The HTML is used to create multiple radio buttons, allowing users to choose one option. All options share the same name attribute, ensuring that only one can be selected at a time.
HTML `
<h2><input type="radio"></h2>
<h3>Choose an Option:</h3>
<label>
<input type="radio" name="option"
value="option1"> Option 1
</label>
<label>
<input type="radio" name="option"
value="option2"> Option 2
</label>
<label>
<input type="radio" name="option"
value="option3"> Option 3
</label>
`
Use cases
Some use cases are given below: