Last Updated : 05 Aug, 2025
In this article, we will learn how to add Radio Buttons in form using HTML. We know that Radio Buttons are used to select only one option out of several options. It is generally used in HTML form. If we want to deselect any option we have to select another option in the case of a radio button.
Approach: To add a radio buttons in a webpage, the HTML provides a <input> element with type attribute is set to "radio".
Syntax:
<input type="radio">
Example: Below code illustrates that how to add a radio button in the webpage.
HTML
<!DOCTYPE html>
<html>
<head>
<style>
body {
text-align: center;
}
h2 {
color: green;
}
</style>
</head>
<body>
<h2>
GeeksforGeeks
</h2>
<h3>
How to add a Radio Buttons in form using HTML?
</h3>
<h4>
Select Gender
</h4>
Male
<input type="radio" checked=true name="user_gender">
Female
<input type="radio" name="user_gender">
</body>
</html>
Output:
gender of userRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4