Languages
[Edit]
EN

HTML - radio input

3 points
Created by:
Palpys
764

In this article, we would like to show you how to create and use radio input elementin HTML.

Quick solution:

 

Notes:

  • radio input elements are assigned to groups by name attribute,
  • one that group creates single field,
  • only one radio button can be selected per field at the same time.

 

Practical examples

Edit

In this examples, we create radio input using the input element's type="radio" attribute, assigning elements for fields by name attributes.

 

1. Single field (one group)

Edit

 

2. Multiple fields (two groups)

Note: You can create more fields if needed, remembering to use different names.

 

See also

Edit
  1. HTML - select radio input on click on related text

References

Edit
  1. <input type="radio"> - HTML | MDN

Alternative titles

  1. HTML - input type radio
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

HTML - input element types

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join