VOOZH about

URL: https://www.geeksforgeeks.org/html/html-input-typeradio/

⇱ HTML <input type=”radio”> - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML <input type=”radio”>

Last Updated : 23 May, 2026

The <input type="radio"> 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:

<input type="radio" name="groupName" value="option">

Note: The value attribute gives each radio button a unique identifier, helping identify the selected option upon form submission.

Example 1: The HTML <input type="radio"> 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.

Example 2: The HTML <input type="radio"> 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.

Use cases

Some use cases are given below:

Comment
Article Tags: