Radio button in HTML

Radio buttons are used if it is necessary to choose a single item from the list. If you want to choose several items, it's better to use checkbox element.
Radio buttons are created as follows.
<input type="radio" parameters>
Field parameters are listed in the table.
Parameter | Description |
---|---|
name | Name of the field. Designed for the form handler to identify the field. |
value | The field value defines what will be sent to the server. |
checked | Sets the item which is selected by default. |
Field name (parameter name) for all the group elements must have the same value. This way the browser will correctly mark the selected items (example 1).
Example 1. Using radio buttons.
<form action="/cgi-bin/handler.cgi"> <b>What do you think the abbreviation "OS" stands for?</b><br> <input type="radio" name="answer" value="a1">Officer Standpoint<br> <input type="radio" name="answer" value="a2">Operating System<br> <input type="radio" name="answer" value="a3">Obese Singularity </form>
The result is shown below.