Toggle Buttons: The buttons that can change from one state to another, i.e. which can be toggled from on state to off state or vice-versa are called toggle buttons. For example:
- A particular switch in our house can either be on or off. This is a very good example of a real life toggle switch.
- The WiFi or Bluetooth option in our phone is another example, that can either be on or off.
Radio Button: As the name suggests, it is the concept of the buttons in a radio, where for the first station, we select the first button, for the second station we select the second button and so on. It is like a multiple-choice question where at a time only one button will be active. Here we select from a list of options. For example:
- Buttons in a FM Radio.
- Multiple choice questions in an exam.
Example: Create a radio button using Bootstrap.
- We have to add a checked attribute to any one of the radio buttons such that it is pre-selected when the page loads. It is a boolean attribute.
- The same name has to be given to all the set of elements.
Example 2: The following code will help us to understand the difference (in code) to design a toggle and a radio button.
- How to Create Custom Radio Button using HTML and CSS ?
- How to get button toggle state within HTML?
- Radio Button Vs Checkbox in HTML
- How to know which radio button is selected using jQuery?
- How to check a radio button with jQuery?
- Bootstrap 4 | Button Groups
- Bootstrap 5 | Button group
- Bootstrap 5 | Close button
- How to set the button alignment in Bootstrap ?
- How to make bootstrap button transparent ?
- How to place button in top Right corner using bootstrap?
- How to align button to right side of text box in Bootstrap?
- How to set div with left image and button at bottom using bootstrap?
- How to enable Bootstrap tooltip on disabled button ?
- How to change (-, +) symbol with a button in Bootstrap Accordion ?
- How to change the position of modal close button in bootstrap?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.