Difference between radio button and checkbox
Radio button | Checkbox |
---|---|
Radio button is used when only one option to be selected out of several available options. | Checkbox allows one or many options to be selected. |
Radio button is created by using HTML <input> tag but type attribute is set to radio. | It is also created using HTML <input> tag but type attribute is set to checkbox. |
Radio button is a single control unit. | It is a multiple control unit. |
Radio button is presented as a small circle on the screen. | Checkbox is presented as a small square box on the screen. |
Radio button have only 2 states namely- True & False. | Checkbox have 3 states namely- Checked, unchecked & indeterminate. |
Radio button is used when you want to limit the users choice to just one option from the range provided. | It is used when you want to allow user to select multiple choices. |
Radio Button Vs Checkbox in HTML
Radio buttons allow users to select only one option from a group, while checkboxes permit multiple selections. Use radio buttons when exclusive choices are needed, and checkboxes for multiple independent choices.
Table of Content
- Radio button
- Checkbox
Contact Us