HTML Radio Tag - HTML Tutorial

HTML Radio Tag

BLUF: Mastering HTML Radio Tag is a fundamental step in becoming a web developer. This guide covers the structure, syntax, and best practices for using this HTML element effectively.
Key Lesson: HTML Radio Tag

Web structure starts with solid HTML. Learn how HTML Radio Tag contributes to accessible and semantic web pages in the tutorial below.

The HTML <Radio> button is employed to specify radio buttons, which are accentuated upon selection. This form component permits users to choose just one option from a provided set of choices.

It is generated by the type attribute of the <input> tag as illustrated in the syntax below:

Example

<input type="radio" name ="Any_name"/>

Example

Example

html>

<head>

</head>

<title> Example of Radio Button</title>

<body>

<form>

  

<label>

Gender: 

</label>  <br>

<input type="radio" id="gender" name="gender" value="male"/> Male  

<br>

<input type="radio" id="gender" name="gender" value="female"/> Female <br/> 

</form>  

</body>

</html>

Output:

Browser Support

Element Chrome IE Firefox Opera Safari
<radio> Yes Yes Yes Yes Yes

Input Required

This code uses input(). Please provide values below:

Logic Practice
Install Logic Practice
Add to home screen for a faster app-like experience