How to add Radio Buttons in form using HTML ?
We know that Radio Buttons are used to select only one option out of the several options. It is generally used in HTML form.
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 user
Please Login to comment...